[#bsl-variant_alternative-0c] = xref:bsl.adoc[bsl]::variant_alternative :relfileprefix: ../ :mrdocs: Compute the type of the alternative at index `t_INDEX`. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< std::size_t t_INDEX, class t_TYPE> struct variant_alternative; ---- == Description This metafunction calculates the type of the alternative whose index is (template parameter) `t_INDEX` in the possibly cv‐qualified `bsl::variant` type of (template parameter) `t_TYPE`. If `t_TYPE` is cv‐qualified, its cv‐qualifiers are applied to the alternative. == Specializations [cols="1,4"] |=== | Name| Description | xref:bsl/variant_alternative-09.adoc[`variant_alternative<t_INDEX, t_TYPE volatile>`] | Strip `volatile` from `t_TYPE` before computing the alternative type. | xref:bsl/variant_alternative-0d.adoc[`variant_alternative<t_INDEX, t_TYPE const>`] | Strip `const` from `t_TYPE` before computing the alternative type. | xref:bsl/variant_alternative-0f.adoc[`variant_alternative<t_INDEX, t_TYPE const volatile>`] | Strip `const volatile` from `t_TYPE` before computing the alternative type. | 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]#