Using std :: variant in g ++

How to use std::variant in g++ ? Why is there no std::variant in std::experimental (although std::optional is)? What version of g++ do I need? I prefer not to use boost , and I would like to use only the standard library.

Edit: only g++ 7 seems to support std::variant . Then my question is: when will it be released and what problems can arise when using its experimental version?

+5
source share
2 answers

This page says that GCC 7 has std::variant .

+3
source

GCC has an information page where you can check which language function was implemented with which version. It seems that variant has not yet been implemented.

+3
source

Source: https://habr.com/ru/post/1261717/


All Articles