<div dir="auto">A few points... All my personal opinions.  Written on a phone, so sorry for the bad writing<div dir="auto"><br></div><div dir="auto">Writing happens once</div><div dir="auto">Modifying happens occasionally </div><div dir="auto">Debugging through and reading happen continuously throughout the community</div><div dir="auto"><br></div><div dir="auto">GDAL is probably the largest source of oss fuzz bugs.  I think we should be doing more, not less, to make the system more stable and debugable. </div><div dir="auto"><br></div><div dir="auto">Each individual change might not seen like much, but they really add up. </div><div dir="auto"><br></div><div dir="auto">There is a lot I have to keep in my head for gdal that I don't with other code bases because the are using the current conventions that help with so many issues and give common ground.</div><div dir="auto"><br></div><div dir="auto">Well done C++ makes being large scale systems so much easier and modernizing GDAL means the whole community will get more out of GDAL.</div><div dir="auto"><br></div><div dir="auto">These points are especially true with the sprawling style of GDAL. </div><div dir="auto"><br></div><div dir="auto">Things like consexpr are easy and set us up for lower maintenance costs in the future with C++14, 17 and beyond.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Dec 16, 2017 1:27 AM, "Andrew C Aitchison" <<a href="mailto:andrew@aitchison.me.uk">andrew@aitchison.me.uk</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, 15 Dec 2017, Even Rouault wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Kurt,<br>
<br>
It doesn't look like constexpr is available in VS2013 (at least not in all sub-versions of it):<br>
<a href="https://stackoverflow.com/questions/20264644/constexpr-not-compiling-in-vc2013" rel="noreferrer" target="_blank">https://stackoverflow.com/ques<wbr>tions/20264644/constexpr-not-<wbr>compiling-in-vc2013</a><br>
<br>
Personnally, I don't see it as a super needed feature that would justify dropping VS2013<br>
support. Especially in the below use cases where it doesn't bring anything more than const,<br>
except more characters to type/read. I'd bet any sane compiler in -O2 will compile the source<br>
to the same machine code in all those cases<br>
</blockquote>
<br>
As a C programmer, writing gdal device drivers is teaching me much about C++, but I'm finding it difficult to understand why I should need to care<br>
whether a const is a constexpr.<br>
<br>
Except in the rare case where I might want a value that cannot be initialised<br>
at compile time, but my code must not change once it has been initialised,<br>
I don't see the need to distinguish between the two and wish that a const<br>
was a constexpr unless otherwise declared.<br>
<br>
I worry that Kurt's improvements are turning C++ into a foreign language for me.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On vendredi 15 décembre 2017 07:04:23 CET you wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: goatbar<br>
Date: 2017-12-15 07:04:23 -0800 (Fri, 15 Dec 2017)<br>
New Revision: 41044<br>
<br>
Modified:<br>
   trunk/gdal/port/cpl_conv.cpp<br>
Log:<br>
const -> constexpr for things known at compile time in cpl_conv.cpp<br>
<br>
<br>
Modified: trunk/gdal/port/cpl_conv.cpp<br>
==============================<wbr>==============================<wbr>=======<br>
--- trunk/gdal/port/cpl_conv.cpp        2017-12-15 14:37:43 UTC (rev 41043)<br>
+++ trunk/gdal/port/cpl_conv.cpp        2017-12-15 15:04:23 UTC (rev 41044)<br>
@@ -340,8 +340,8 @@<br>
 /****************************<wbr>******************************<wbr>**************/<br>
<br>
 // ASCII characters.<br>
-static const char knLF = 10;<br>
-static const char knCR = 13;<br>
+constexpr char knLF = 10;<br>
+constexpr char knCR = 13;<br>
<br>
 /**<br>
  * Reads in at most one less than nBufferSize characters from the fp<br>
@@ -666,7 +666,7 @@<br>
 /*      the line.                                                       */<br>
 /* ------------------------------<wbr>------------------------------<wbr>-------- */<br>
     char *pszRLBuffer = nullptr;<br>
-    const size_t nChunkSize = 40;<br>
+    constexpr size_t nChunkSize = 40;<br>
     char szChunk[nChunkSize] = {};<br>
     size_t nChunkBytesRead = 0;<br>
     int nBufLength = 0;<br>
@@ -1984,8 +1984,8 @@<br>
 /*                            CPLDMSToDec()                             */<br>
 /****************************<wbr>******************************<wbr>**************/<br>
<br>
-static const char *sym = "NnEeSsWw";<br>
-static const double vm[] = { 1.0, 0.0166666666667, 0.00027777778 };<br>
+constexpr char sym[] = "NnEeSsWw";<br>
+constexpr double vm[] = { 1.0, 0.0166666666667, 0.00027777778 };<br>
<br>
 /** CPLDMSToDec */<br>
 double CPLDMSToDec( const char *is )<br>
@@ -2605,7 +2605,7 @@<br>
 /* ------------------------------<wbr>------------------------------<wbr>-------- */<br>
 /*      Prepare buffer.                                                 */<br>
 /* ------------------------------<wbr>------------------------------<wbr>-------- */<br>
-    const size_t nBufferSize = 1024 * 1024;<br>
+    constexpr size_t nBufferSize = 1024 * 1024;<br>
     GByte *pabyBuffer = static_cast<GByte<br>
*>(VSI_MALLOC_VERBOSE(nBufferS<wbr>ize)); if( pabyBuffer == nullptr )<br>
     {<br>
<br>
______________________________<wbr>_________________<br>
gdal-commits mailing list<br>
<a href="mailto:gdal-commits@lists.osgeo.org" target="_blank">gdal-commits@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-commits" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-commits</a><br>
</blockquote>
<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</blockquote>
<br>______________________________<wbr>_________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">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/<wbr>mailman/listinfo/gdal-dev</a><br></blockquote></div></div>