<div dir="ltr">Reverted in <a href="https://trac.osgeo.org/gdal/changeset/41045">https://trac.osgeo.org/gdal/changeset/41045</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 15, 2017 at 3:49 PM, Kurt Schwehr <span dir="ltr"><<a href="mailto:schwehr@gmail.com" target="_blank">schwehr@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ugh.  constexpr would be nice to get started on, but yes, many of the wins come in more with C++14 and C++17.<div><br></div><div><a href="https://ci.appveyor.com/project/OSGeo/gdal/build/1.0.4152/job/y7fusq8a4lopxpni" target="_blank">https://ci.appveyor.com/<wbr>project/OSGeo/gdal/build/1.0.<wbr>4152/job/y7fusq8a4lopxpni</a><br></div><div><br></div><div><span style="font-family:"Segoe UI","Helvetica Neue",Helvetica,Helvetica,Arial,sans-serif;font-size:12.8px">Environment: platform=x86, VSCOMNTOOLS=$(VS120COMNTOOLS), SDK=release-1800, MSVC_VER=1800</span><br></div><div><br></div><div><div>cpl_error.cpp</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(343) : error C2144: syntax error : 'char' should be preceded by ';'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(343) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(344) : error C2144: syntax error : 'char' should be preceded by ';'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(344) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(344) : error C2086: 'int constexpr' : redefinition</div><div>        c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(343) : see declaration of 'constexpr'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(669) : error C2146: syntax error : missing ';' before identifier 'size_t'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(669) : error C2146: syntax error : missing ';' before identifier 'nChunkSize'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(669) : error C2275: 'size_t' : illegal use of this type as an expression</div><div>        c:\projects\gdal\gdal\port\<wbr>predefined c++ types (compiler internal)(19) : see declaration of 'size_t'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(669) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(670) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(682) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(691) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(702) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(702) : error C2660: 'VSIFReadL' : function does not take 3 arguments</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(709) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(760) : error C2065: 'nChunkSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1987) : error C2144: syntax error : 'char' should be preceded by ';'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1987) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1987) : error C2086: 'int constexpr' : redefinition</div><div>        c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(343) : see declaration of 'constexpr'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1988) : error C2144: syntax error : 'double' should be preceded by ';'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1988) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(1988) : error C2086: 'int constexpr' : redefinition</div><div>        c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(343) : see declaration of 'constexpr'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2608) : error C2146: syntax error : missing ';' before identifier 'size_t'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2608) : error C2146: syntax error : missing ';' before identifier 'nBufferSize'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2608) : error C2275: 'size_t' : illegal use of this type as an expression</div><div>        c:\projects\gdal\gdal\port\<wbr>predefined c++ types (compiler internal)(19) : see declaration of 'size_t'</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2608) : error C2065: 'nBufferSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2609) : error C2065: 'nBufferSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2624) : error C2065: 'nBufferSize' : undeclared identifier</div><div>c:\projects\gdal\gdal\port\<wbr>cpl_conv.cpp(2631) : error C2065: 'nBufferSize' : undeclared identifier</div><div>cpl_string.cpp</div><div>cplstring.cpp</div></div><div><br></div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Fri, Dec 15, 2017 at 9:22 AM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'Sans Serif';font-size:9pt;font-weight:400;font-style:normal">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Kurt,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">It doesn't look like constexpr is available in VS2013 (at least not in all sub-versions of it):</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="https://stackoverflow.com/questions/20264644/constexpr-not-compiling-in-vc2013" target="_blank">https://stackoverflow.com/ques<wbr>tions/20264644/constexpr-not-<wbr>compiling-in-vc2013</a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Personnally, I don't see it as a super needed feature that would justify dropping VS2013 support. Especially in the below use cases where it doesn't bring anything more than const, except more characters to type/read. I'd bet any sane compiler in -O2 will compile the source to the same machine code in all those cases</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Even</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On vendredi 15 décembre 2017 07:04:23 CET you wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Author: goatbar</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Date: 2017-12-15 07:04:23 -0800 (Fri, 15 Dec 2017)</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> New Revision: 41044</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Modified:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>    trunk/gdal/port/cpl_conv.cpp</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Log:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> const -> constexpr for things known at compile time in cpl_conv.cpp</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Modified: trunk/gdal/port/cpl_conv.cpp</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ==============================<wbr>==============================<wbr>=======</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> --- trunk/gdal/port/cpl_conv.cpp      2017-12-15 14:37:43 UTC (rev 41043)</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +++ trunk/gdal/port/cpl_conv.cpp      2017-12-15 15:04:23 UTC (rev 41044)</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> @@ -340,8 +340,8 @@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /*****************************<wbr>******************************<wbr>*************/</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  // ASCII characters.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -static const char knLF = 10;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -static const char knCR = 13;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +constexpr char knLF = 10;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +constexpr char knCR = 13;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /**</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>   * Reads in at most one less than nBufferSize characters from the fp</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> @@ -666,7 +666,7 @@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /*      the line.                                                       */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /* ------------------------------<wbr>------------------------------<wbr>-------- */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      char *pszRLBuffer = nullptr;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -    const size_t nChunkSize = 40;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +    constexpr size_t nChunkSize = 40;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      char szChunk[nChunkSize] = {};</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      size_t nChunkBytesRead = 0;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      int nBufLength = 0;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> @@ -1984,8 +1984,8 @@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /*                            CPLDMSToDec()                             */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /*****************************<wbr>******************************<wbr>*************/</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -static const char *sym = "NnEeSsWw";</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -static const double vm[] = { 1.0, 0.0166666666667, 0.00027777778 };</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +constexpr char sym[] = "NnEeSsWw";</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +constexpr double vm[] = { 1.0, 0.0166666666667, 0.00027777778 };</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /** CPLDMSToDec */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  double CPLDMSToDec( const char *is )</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> @@ -2605,7 +2605,7 @@</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /* ------------------------------<wbr>------------------------------<wbr>-------- */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /*      Prepare buffer.                                                 */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>  /* ------------------------------<wbr>------------------------------<wbr>-------- */</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -    const size_t nBufferSize = 1024 * 1024;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +    constexpr size_t nBufferSize = 1024 * 1024;</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      GByte *pabyBuffer = static_cast<GByte</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> *>(VSI_MALLOC_VERBOSE(nBufferS<wbr>ize)); if( pabyBuffer == nullptr )</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>      {</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> ______________________________<wbr>_________________</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> gdal-commits mailing list</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> <a href="mailto:gdal-commits@lists.osgeo.org" target="_blank">gdal-commits@lists.osgeo.org</a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-commits" target="_blank">https://lists.osgeo.org/mailma<wbr>n/listinfo/gdal-commits</a></p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div class="m_7100244400815107861gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--<div><a href="http://schwehr.org" target="_blank">http://schwehr.org</a></div></div>
</div>