I'm using a Teensy 3.6 microcontroller. I want to use std::optional but I got some errors.
I use c++17.
platform_packages =
toolchain-gccarmnoneeabi@~1.90301.0
src\MainTest\maintest.cpp:19:6: error: 'optional' in namespace 'std' does not name a template type
19 | std::optional<int> opt{1};
| ^~~~~~~~
src\MainTest\maintest.cpp:19:1: note: 'std::optional' is only available from C++17 onwards
Indexing .pio\build\teensy36\lib63e\libHAL.a
19 | std::optional<int> opt{1};
| ^~~
src\MainTest\maintest.cpp:20:12: error: 'opt' was not declared in this scope
20 | auto val = opt.value();
I'm using a Teensy 3.6 microcontroller. I want to use std::optional but I got some errors. I use c++17. platform_packages = toolchain-gccarmnoneeabi@~1.90301.0