[QGIS-Developer] QEP 314: Relax prohibition against "auto"

Nyall Dawson nyall.dawson at gmail.com
Thu Feb 6 14:22:54 PST 2025


On Thu, 6 Feb 2025 at 08:40, Nyall Dawson <nyall.dawson at gmail.com> wrote:
>
> On Thu, 23 Jan 2025 at 09:25, Nyall Dawson <nyall.dawson at gmail.com> wrote:
> >
> > Hi all,
> >
> > Please see https://github.com/qgis/QGIS-Enhancement-Proposals/pull/319
> > for a proposed change to the QGIS coding policies to relax the current
> > prohibition against use of "auto" in some new cases.
> >
> > Specifically, allowing use of "auto" for variable types when the
> > variable type is explicitly stated during its initialization:
> >
> > auto may be used for variable types if the type is explicit during
> > variable initialization. Eg
> >
> > // allowed, as the QgsPoint type is explicit during initialization:
> > auto pointObject = QgsPoint( 3, 4 );
> > // allowed, as the std::unique_ptr< QgsPoint >, std::shared_ptr<
> > QgsPoint > types are explicit during initialization:
> > auto pointUniquePointer = std::make_unique< QgsPoint >( 3, 4 );
> > auto pointSharedPointer = std::make_shared< QgsPoint >( 3, 4 );
> >
> > // NOT allowed, the argument types for the std::tuple are not explicit:
> > auto myTuple = std::make_tuple( 0, 5 );
> >
> > Please keep discussion on
> > https://github.com/qgis/QGIS-Enhancement-Proposals/pull/319 so that we
> > have a formal record of the discussion.
>
> This proposal has passed the 2 week discussion phase and is ready for
> voting now.

Declaring as passed with approval from nirvn, rouault, alexbruy,
m-kuhn, troopa81 and elpaso

Thanks all!
Nyall


>
> Nyall


More information about the QGIS-Developer mailing list