<div dir="ltr"><div>Hi Sandro<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 15, 2021 at 5:32 PM Sandro Santilli <<a href="mailto:strk@kbt.io">strk@kbt.io</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
My question is: why is a QgsFeatureIterator being constructed here,<br>
just for returning it as a value ?</blockquote><div><br></div><div>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).<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Why not returning a pointer<br>
instead, to allow subclasses to return whatever derived class they want ?<br></blockquote><div><br></div><div>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...<br></div><div> </div><div>Regards</div><div>Martin</div><div><br></div></div></div>