BloombergLP::bslstl::Variant_TypeToIndex

Compute the zero-based index of t_TYPE in t_VARIANT's alternatives.

Synopsis

Declared in <bslstl_variant.h>

template<
    class t_TYPE,
    class t_VARIANT>
struct Variant_TypeToIndex;

Description

This component-private metafunction calculates the zero-based index of (template parameter) t_TYPE in the list of alternatives in (template parameter) t_VARIANT, or bsl::variant_npos if there is no such alternative.

The primary template (used when t_VARIANT is not a bsl::variant) is not defined.

Specializations

NameDescription
Variant_TypeToIndex<t_TYPE, bsl::variant<t_HEAD, t_TAIL...>> Compute the zero-based index of t_TYPE in a bsl::variant.