Here is a range based for replacement of an iterator as a starter for comments/discussion:
https://trac.osgeo.org/gdal/changeset/41019 <https://www.google.com/url?sa=D&q=https%3A%2F%2Ftrac.osgeo.org%2Fgdal%2Fchangeset%2F41019> On Tue, Dec 12, 2017 at 7:27 PM, Kurt Schwehr <schw...@gmail.com> wrote: > +1 on the range based for > > +1 on std::unique_ptr, but ... I think GDAL should stick to these: > > - Do not do "using std::unique_ptr;" > - Do not exposed std::unique_ptr to any public interfaces (for the time > being) > > On Tue, Dec 12, 2017 at 4:06 AM, Even Rouault <even.roua...@spatialys.com> > wrote: > >> > 1. std::unique_ptr >> >> > >> >> [...] >> >> > >> >> > Hopefully this will help to reduce the incidence of memory leaks. >> >> >> >> +1, that's one of the benefits of C++11 >> >> > >> >> > -- >> >> > >> >> > 2. auto >> >> > >> >> > I'd like to not have to write >> >> > >> >> > for( std::vector<std::unique_ptr<OGRFeature>>::iterator oIt = >> >> > apoMyList.begin(); >> >> > >> >> > and simply write >> >> > >> >> > for( auto oIt = apoMyList.begin(); >> >> >> >> +1. You could even use range based loop >> >> >> >> for( auto& olt: apoMyList ) >> >> >> >> (or auto const& depending on what you want to do with it) >> >> >> >> Even >> >> >> >> -- >> >> Spatialys - Geospatial professional services >> >> http://www.spatialys.com >> >> _______________________________________________ >> gdal-dev mailing list >> gdal-dev@lists.osgeo.org >> https://lists.osgeo.org/mailman/listinfo/gdal-dev >> > > > > -- > -- > http://schwehr.org > -- -- http://schwehr.org
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev