c++17 std::optional


Active member

I'm trying to port an application of my from the ESP32/RP2040 to the Teensy 4.1 platform.
It uses std:: optional but that does not seem to be supported?
Any plans to do so?

Oh wait, it is already available yet as I'm using platformio not available directly to me. I'll see if I can change that.
(for google) add:

platform_packages = platformio/framework-arduinoteensy@^1.159.0
build_flags = -std=gnu++17
build_unflags = -std=gnu++14

to platformio.ini.
Last edited:
Good news is that with the latest Teensyduino 1.59 release on PlatformIO, the default is now C++17. No need to add or remove flags. Note that you might need to run pio pkg update from the command line to get the latest. (I’m not actually sure if there’s a menu option for that; there might be. I’m also not sure if it will be done automatically at some point.)