[#bsl-variant_size-09]
= xref:bsl.adoc[bsl]::xref:bsl/variant_size-07.adoc[variant&lowbar;size]&lt;xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&gt;
:relfileprefix: ../
:mrdocs:

Provide the number of alternatives of a `bsl&colon;&colon;variant` specialization&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;variant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;HEAD,
    class&period;&period;&period; t&lowbar;TAIL&gt;
struct xref:bsl/variant_size-07.adoc[variant&lowbar;size]&lt;xref:bsl/variant.adoc[variant&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&gt;
    : xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;std::size&lowbar;t, 1 &plus; sizeof&period;&period;&period;(t&lowbar;TAIL)&gt;]
    , xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;size&lowbar;t, 1 &plus; sizeof&period;&period;&period;(t&lowbar;TAIL)&gt;]
----

== Description

This partial specialization of `variant&lowbar;size` provides the number of alternatives, `1 &plus; sizeof&period;&period;&period;(t&lowbar;TAIL)`, for a `bsl&colon;&colon;variant` specialized on (template parameters) `t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;`&period;

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;std::size&lowbar;t, 1 &plus; sizeof&period;&period;&period;(t&lowbar;TAIL)&gt;]`
| Metafunction representing a compile&hyphen;time constant of the specified (template parameter) `t&lowbar;TYPE` with the specified (template parameter) `t&lowbar;VALUE`&period;
| `xref:bsl/integral_constant-02.adoc[bsl::integral&lowbar;constant&lt;size&lowbar;t, 1 &plus; sizeof&period;&period;&period;(t&lowbar;TAIL)&gt;]`
| Metafunction representing a compile&hyphen;time constant of the specified (template parameter) `t&lowbar;TYPE` with the specified (template parameter) `t&lowbar;VALUE`&period;
|===

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/type.adoc[`type`] 
| Alias for this `integral&lowbar;constant` specialization&period;
| xref:bsl/integral_constant-02/value_type.adoc[`value&lowbar;type`] 
| Alias for the (template parameter) `t&lowbar;TYPE`&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/operator_call.adoc[`operator()`] 
| Return a copy of the template argument `t&lowbar;VALUE`&period;
| xref:bsl/integral_constant-02/2conversion.adoc[`operator t&lowbar;TYPE`] 
| Return a copy of the template argument `t&lowbar;VALUE`&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:bsl/integral_constant-02/value.adoc[`value`] 
| The compile&hyphen;time constant value of this metafunction&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
