On mardi 15 mai 2018 14:09:45 CEST Kurt Schwehr wrote: > Hi Even, > > Trying to get caught up going through patches. A comment for this one: > > https://github.com/OSGeo/gdal/blob/f7c27a807b27cf74cf4666ffe3df4d64cc3f47b3/ > gdal/frmts/gtiff/geotiff.cpp > > You can size and initialize a vector in the constructor. With this code: > > std::vector<bool> abRequireNewOverview; > abRequireNewOverview.resize(nOverviews); > for( int i = 0; i < nOverviews && eErr == CE_None; ++i ) > { > abRequireNewOverview[i] = true; > > The vector can be setup all at one go... > > std::vector<bool> abRequireNewOverview(nOverviews, true);
Kurt, Yeah, I know this kind of initialization exists. My issue is that I never remember if this is count, value or value, count and when this is a vector<int> (and presumably vector<bool>), the compiler cannot yell at you if you got it wrong... I miss named parameters there... That said I've fixed the above instance and similar ones as you suggest. Even -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
