Hello,
Some time ago I successfully developed a sketch for the ESP8266 board, which was using std::optional.
I'm now trying to port it to Arduino Uno, using an Ethernet W5500 shield.
Unfortunately the compiler keeps complaining with the message:
'optional' in namespace 'std' does not name a template type
std::optional ethernetClient_SC;
This same behavior occurs on both Arduino IDE 1.8.x and 2.0.x fresh install.
#include <Ethernet.h>
#include <EthernetUdp.h>
#include <SPI.h>
#include <Dns.h>
#include <Dhcp.h>
#include <NtpClientLib.h>
#include <TimeLib.h>
std::optional<EthernetClient> ethernetClient_SC;
Afaik, std::optional is part of the C++17 standard.
So, does IDE 2.0.x for Arduino Uno fully supports the C++17 standard? Or perhaps it only supports part of the standard?...
Anyway, is there a (simple :-)) way for me to keep using std::optional?
Thank you!
PS-Not sure this question is in the right category... perhaps it should have been in Arduino IDE category instead?...