I am working on writing a program for the nodemcu ESP8266, and I would like to use some features from C++17. However, adding this to the build flags doesn’t work as the native g++ compiler is pretty outdated (thanks to arduino). Is it possible to use C++17 in this context? If so, how would I go about doing that?
This is the ini file I tried to use by the way, but as expected the ‘-std=c++17’ flag is not recognized.
Espressif has recently released a new toolchain based on gcc/g++ 8, which supports C++ 17. It goes along with release 4 of their ESP-IDF framework. As it is still in beta, the framework and the associated toolchain haven’t been integrated into PlatformIO.
There might be some trick to use the new toolchain with PlatformIO already now. But I’m not a specialist for it and likely it would reveal incompatibilities and cause problems.
So you have two options:
Wait until ESP-IDF 4.0 has been released and integrated into PlatformIO. I haven’t seen a roadmap from Espressif. So it’s difficult to tell when it will happen.
Use the ESP-IDF 4.0 beta framework and the new toolchain without PlatformIO.