MicroStation Programming Forum - [Connect U17 c++] Support for C++20 or 17
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

[Connect U17 c++] Support for C++20 or 17

by
Mauricio Terneus
Expert

I have updated to the latest SDK for Connect which has a default toolset requirement of VS2019 or better.  As such, I would expect that c++17 or c++20 features would be recognized.

When trying to use c++17 features,

const std::string myString = "My Hello World Wow";
if (const auto it = myString.find("World"); it != std::string::npos)
std::cout << it << " World\n";
else
std::cout << it << " not found!!\n";

I am getting a build error

error C2429: language feature 'init-statements in if/switch' requires compiler flag '/std:c++17'

Are the newer iterations of c++ supported by the latest SDK, and if so how would I go about modifying the makefile to add the compiler flag?

Thanks!