[gdal-dev] Use of C++ iterators in API

Mateusz Loskot mateusz at loskot.net
Wed Apr 11 06:02:30 PDT 2018


On 11 April 2018 at 14:40, Even Rouault <even.rouault at spatialys.com> wrote:
> On mercredi 11 avril 2018 05:10:53 CEST Kurt Schwehr wrote:
>> The auto&& is really confusing.
>
> A experimentally working alternative with miminal use of '&' is
>
>     for( auto poLayer: poDS->GetLayers() )  <-- this is a plain OGRLayer*

IMHO, it's better to get users familar with these two:

auto const& - as preferred default
auto& - where one requires, explicitly

It should cover 99.9% of uses :)

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net


More information about the gdal-dev mailing list