简体   繁体   中英

Using std::variant in g++

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?

这个页面说,GCC 7有std::variant

GCC has an info page where you can check which language feature was implemented with which version. It looks like variant is not yet implemented.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM