BloombergLP::bslstl::Variant_TypeToIndexImpl

This component-private metafunction provides implementation for Variant_TypeToIndex. It evaluates to t_INDEX + i where i is the zero-based index of (template parameter) t_TYPE in (template parameters) t_HEAD, t_TAIL..., or bsl::variant_npos if t_TYPE is not found.

Synopsis

Declared in <bslstl_variant.h>

template<
    size_t t_INDEX,
    class t_TYPE,
    class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE,
    class... t_TAIL>
struct Variant_TypeToIndexImpl
    : bsl::conditional<bsl::is_same<t_TYPE, t_HEAD>::value, bsl::integral_constant<size_t, t_INDEX>, Variant_TypeToIndexImpl<t_INDEX + 1, t_TYPE, t_TAIL...>>::type

Base Classes

NameDescription
bsl::conditional<bsl::is_same<t_TYPE, t_HEAD>::value, bsl::integral_constant<size_t, t_INDEX>, Variant_TypeToIndexImpl<t_INDEX + 1, t_TYPE, t_TAIL...>>::type

Specializations

NameDescription
Variant_TypeToIndexImpl<t_INDEX, t_TYPE, BSLSTL_VARIANT_NOT_A_TYPE> This partial specialization is used when the list of alternatives t_HEAD, t_TAIL... is empty, i.e., t_TYPE wasn't found in the originally supplied list of alternatives.