std::variant_alternative
Closed this issue · 4 comments
strasdat commented
Is there an equivalent to std::variant_alternative
(http://en.cppreference.com/w/cpp/utility/variant/variant_alternative)?
I could not find it, but maybe I just did not look hard enough ;)
artemp commented
@strasdat - there are some meta-functions to get index
for a particular type but not other way around.
If you have a compelling use-case for variant_alternative
could you share it here, so it can be used as inspiration to add support, pls.
artemp commented
strasdat commented
Thanks; motivation is serialization/deserialization; using frameworks such as boost serialization or cereal.
I will see whether I find some time to try this out tonight...
artemp commented
variant_size
and variant_alternative
are now in master.