Hi Sandro

On Fri, Oct 15, 2021 at 5:32 PM Sandro Santilli <[email protected]> wrote:

> My question is: why is a QgsFeatureIterator being constructed here,
> just for returning it as a value ?


If I remember correctly, that's mainly for convenience in the client code,
no need to deal with raw pointers that need to be deleted afterwards.
QgsFeatureIterator also adds implicit sharing, just like many other Qt
classes do (e.g. QString).


> Why not returning a pointer
> instead, to allow subclasses to return whatever derived class they want ?
>

Well, in that code snippet we are already in a subclass that returns the
derived class as wanted, so I am not sure if I understand your concern...

Regards
Martin
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to