[gdal-dev] Updating requirements to C++20 for GDAL 3.13 ?

Kurt Schwehr schwehr at gmail.com
Tue Dec 16 23:19:30 PST 2025


Long ago, I wrote
https://gdal.org/en/stable/development/rfc/rfc68_cplusplus11.html. The
world is moving so much faster now compared to back then.

I'm for switching to C++20 as the minimum. Looking at compiler support
tables, it might be that we pick minimum versions for GCC, CLANG, and MSVC.
The project would then be constrained to not use a few specific corners of
C++20 until the next time the minimum compiler versions are upped.

Newer versions of the C++ specification generally lead to improvements in
code bases.

https://en.cppreference.com/w/cpp/20.html
https://en.cppreference.com/w/cpp/compiler_support.html#cpp20

To go with that, I see that PyPI still states Python >= 3.8. That should be
upped to >= 3.10 as 3.9 was end-of-life at the end of October.

https://pypi.org/project/GDAL/
https://devguide.python.org/versions/
https://github.com/OSGeo/gdal/issues/13577 - Set Python minimum version to
be 3.10


On Tue, Dec 16, 2025 at 2:49 PM Even Rouault via gdal-dev <
gdal-dev at lists.osgeo.org> wrote:

> Hi,
>
> any thoughts on :
>
> 1) updating our requirements to build GDAL to C++20 ?
>
> 2) and making use of it in our exported C++ headers ? (thus requiring
> C++ consumers of our API to also be C++20)
>
> Our current situation is C++17 required to build GDAL, and our C++
> exported headers are C++11 compatible (except some newer ones like
> gdalalgorithm_cpp.h, and some bits in )
>
> We already have 2 (optional) dependencies requiring C++20: Poppler and
> PDFium.  The next version of libarrow/libparquet will also require
> C++20. Note that C++20 is currenly only enabled in GDAL in the drivers
> whose dependencies require it.
>
> C++20 should not be an issue with the recent gcc/clang/MSVC. It would
> exclude the old-old-Ubuntu LTS 20.04 whose gcc 9 has only very partial
> support for it, but 20.04 standard support ended a few months ago, so
> not really relevant to consider for new GDAL version.  I'm not totally
> sure about Ubuntu 22.04. It has partial support with its default gcc 11,
> and improved one with gcc 12 that is also available. At the time GDAL
> 3.13 will be released, Ubuntu 26.04 will be released, so 24.04 will be
> old-LTS, and 22.04 old-old-LTS so discarding it if it becomes too much
> of an inconvenience seems fine to me.
>
> A few things that might be interesting in C++20 for our purposes:
>
> - bit manipulation offered by <bit>
> - std::span , particularly when bridging C and C++ API and passing
> non-constant size arrays around
> - defaulted C++20 == operator
> - std::string/string_view::starts_with/ends_with  (finally !)
> - container.contains() (finally !)
>
> Even
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20251216/529fc6c1/attachment.htm>


More information about the gdal-dev mailing list