I am working on vector of std::variant types. Is there a way to convert it to std::tuple of the values holded by given std::variants ?
typedef std::variant<type1, type2,...> a_union;
std::vector<a_union> vec;
For example, I would like to have tuple like:
std::tuple<typeX, typeY, typeX,...>
Where members are types holded by consecutive variants in vector.
This might be a solution for you, it uses optional and returns nullopt if the vector has incorrect values