<div dir="ltr">Hi all,<br><br>Please see <a href="https://github.com/qgis/QGIS-Enhancement-Proposals/pull/330">https://github.com/qgis/QGIS-Enhancement-Proposals/pull/330</a><br>for a proposed change to the QGIS coding policies to relax the current<br>prohibition against use of "<span class="gmail-il">auto</span>" in some (more!) new cases.<div><br></div><div>(This follows up recent changes to permit auto for smart pointer types, seeĀ <a href="https://github.com/qgis/QGIS-Enhancement-Proposals/pull/319">https://github.com/qgis/QGIS-Enhancement-Proposals/pull/319</a>)<br><br>This change relaxes the prohibition against auto to allow use of auto for variable types when the variable type is explicitly stated during its initialization as the result of a cast operation, such as dynamic_cast, static_cast, const_cast, reinterpret_cast, qobject_cast,<br>qgsgeometry_cast, or qgis::down_cast<br><br>Specifically:<br><br>// allowed, the pointer types are explicit during initialization:<br>auto markerSymbol = dynamic_cast< QgsMarkerSymbol* >( symbol );<br>auto vectorLayer = qobject_cast< QgsVectorLayer* >( layer );<br>if ( auto lineString = qgsgeometry_cast< const QgsLineString* >( geometry ) ) { ... }<br><br>// NOT allowed, the type is not explicit:<br>auto myLineStringPtr = downcastGeometryAsLineString( geometry );<br><br>Please keep discussion on<br><a href="https://github.com/qgis/QGIS-Enhancement-Proposals/pull/330">https://github.com/qgis/QGIS-Enhancement-Proposals/pull/330</a> so that we</div><div>have a formal record of the discussion.</div><div><br></div><div>Thanks all!</div><div>Nyall</div><div><br></div></div>