[#bsl-Variant_VariantAlternativeImpl-06e] = xref:bsl.adoc[bsl]::Variant_VariantAlternativeImpl :relfileprefix: ../ :mrdocs: This component‐private metafunction provides the implementation of `bsl::variant_alternative`. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_HEAD = BSLSTL_VARIANT_NOT_A_TYPE, class... t_TAIL> struct Variant_VariantAlternativeImpl : Variant_VariantAlternativeImpl<t_INDEX ‐ 1, t_TAIL...> ---- == Description It recursively strips one type from the front of (template parameters) `t_HEAD, t_TAIL...` for each decrement of (template parameter) `t_INDEX` until `t_INDEX` reaches `0`, at which point the resulting `t_HEAD` is the alternative type. == Base Classes [cols="1,4"] |=== | Name| Description | `Variant_VariantAlternativeImpl<t_INDEX ‐ 1, t_TAIL...>` | This component‐private metafunction provides the implementation of `bsl::variant_alternative`. |=== == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/Variant_VariantAlternativeImpl-00.adoc[`Variant_VariantAlternativeImpl<0, BSLSTL_VARIANT_NOT_A_TYPE>`] | This explicit specialization handles the case of an empty alternative list queried at index `0`. No member typedef is provided. | xref:bsl/Variant_VariantAlternativeImpl-04.adoc[`Variant_VariantAlternativeImpl<t_INDEX, BSLSTL_VARIANT_NOT_A_TYPE>`] | This partial specialization is used when the list of alternatives is exhausted before `t_INDEX` reaches `0`, i.e., `t_INDEX` is out of range. | xref:bsl/Variant_VariantAlternativeImpl-069.adoc[`Variant_VariantAlternativeImpl<0, t_HEAD, t_TAIL...>`] | This partial specialization is the base case of the recursion, reached when `t_INDEX` is `0`; it provides the member typedef `type` equal to `t_HEAD`. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | `Variant_VariantAlternativeImpl` | This component‐private metafunction provides the implementation of `bsl::variant_alternative`. | xref:bsl/variant_alternative-06.adoc[`variant_alternative<t_INDEX, variant<t_HEAD, t_TAIL...>>`] | Compute the alternative type at index `t_INDEX` of a `bsl::variant`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#