mapbox/variant

std::variant_alternative

Closed this issue · 4 comments

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 ;)

@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.

@strasdat - could you try and let me know if variant_alternative works for you #162

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...

variant_size and variant_alternative are now in master.