<div dir="ltr">Any standard upgrade is a balance between making code easier to develop and maintain (better language features) vs reducing the number of people that are able to compile it themselves. Some of those who compile GDAL themselves are doing so because they work on older systems where a newer GDAL is not available via package manger. (Last month someone posted to this list about build issues using gcc 8.5, for example [1]). In this case I'm not sure the balance favors upgrading the standard, but that may be ignorance on my part about C++20 benefits.<div><br></div><div>Dan</div><div><br><div>[1] <a href="https://lists.osgeo.org/pipermail/gdal-dev/2025-November/061170.html">https://lists.osgeo.org/pipermail/gdal-dev/2025-November/061170.html</a></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Dec 16, 2025 at 5:48 PM Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
any thoughts on :<br>
<br>
1) updating our requirements to build GDAL to C++20 ?<br>
<br>
2) and making use of it in our exported C++ headers ? (thus requiring <br>
C++ consumers of our API to also be C++20)<br>
<br>
Our current situation is C++17 required to build GDAL, and our C++ <br>
exported headers are C++11 compatible (except some newer ones like <br>
gdalalgorithm_cpp.h, and some bits in )<br>
<br>
We already have 2 (optional) dependencies requiring C++20: Poppler and <br>
PDFium. The next version of libarrow/libparquet will also require <br>
C++20. Note that C++20 is currenly only enabled in GDAL in the drivers <br>
whose dependencies require it.<br>
<br>
C++20 should not be an issue with the recent gcc/clang/MSVC. It would <br>
exclude the old-old-Ubuntu LTS 20.04 whose gcc 9 has only very partial <br>
support for it, but 20.04 standard support ended a few months ago, so <br>
not really relevant to consider for new GDAL version. I'm not totally <br>
sure about Ubuntu 22.04. It has partial support with its default gcc 11, <br>
and improved one with gcc 12 that is also available. At the time GDAL <br>
3.13 will be released, Ubuntu 26.04 will be released, so 24.04 will be <br>
old-LTS, and 22.04 old-old-LTS so discarding it if it becomes too much <br>
of an inconvenience seems fine to me.<br>
<br>
A few things that might be interesting in C++20 for our purposes:<br>
<br>
- bit manipulation offered by <bit><br>
- std::span , particularly when bridging C and C++ API and passing <br>
non-constant size arrays around<br>
- defaulted C++20 == operator<br>
- std::string/string_view::starts_with/ends_with (finally !)<br>
- container.contains() (finally !)<br>
<br>
Even<br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>