[#bsl-variant_size-09] = xref:bsl.adoc[bsl]::xref:bsl/variant_size-07.adoc[variant_size]<xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]> :relfileprefix: ../ :mrdocs: Provide the number of alternatives of a `bsl::variant` specialization. == Synopsis Declared in `<bslstl_variant.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class t_HEAD, class... t_TAIL> struct xref:bsl/variant_size-07.adoc[variant_size]<xref:bsl/variant.adoc[variant<t_HEAD, t_TAIL...>]> : xref:bsl/integral_constant-02.adoc[bsl::integral_constant<std::size_t, 1 + sizeof...(t_TAIL)>] , xref:bsl/integral_constant-02.adoc[bsl::integral_constant<size_t, 1 + sizeof...(t_TAIL)>] ---- == Description This partial specialization of `variant_size` provides the number of alternatives, `1 + sizeof...(t_TAIL)`, for a `bsl::variant` specialized on (template parameters) `t_HEAD, t_TAIL...`. == Base Classes [cols="1,4"] |=== | Name| Description | `xref:bsl/integral_constant-02.adoc[bsl::integral_constant<std::size_t, 1 + sizeof...(t_TAIL)>]` | Metafunction representing a compile‐time constant of the specified (template parameter) `t_TYPE` with the specified (template parameter) `t_VALUE`. | `xref:bsl/integral_constant-02.adoc[bsl::integral_constant<size_t, 1 + sizeof...(t_TAIL)>]` | Metafunction representing a compile‐time constant of the specified (template parameter) `t_TYPE` with the specified (template parameter) `t_VALUE`. |=== == Type Aliases [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/type.adoc[`type`] | Alias for this `integral_constant` specialization. | xref:bsl/integral_constant-02/value_type.adoc[`value_type`] | Alias for the (template parameter) `t_TYPE`. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/operator_call.adoc[`operator()`] | Return a copy of the template argument `t_VALUE`. | xref:bsl/integral_constant-02/2conversion.adoc[`operator t_TYPE`] | Return a copy of the template argument `t_VALUE`. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:bsl/integral_constant-02/value.adoc[`value`] | The compile‐time constant value of this metafunction. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#