How can I use std::variant
in g++
? Why isn't there std::variant
in std::experimental
(though std::optional
is)? What version of g++
do I need? I prefer not to use boost
and I'd like to use standard library only.
Edit: it seems like only g++ 7
supports std::variant
. Then my question is: when will it be released and what problems may I encounter when using its experimental version?
g++
– Joyg++ -v
org++ --version
in a terminal – Joyg++-6.2
andg++-5.4
. They do not havevariant
unfortunately – Ashjian