[#BloombergLP-bslstl-Variant_Union-0d-2constructor-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_Union-0d.adoc[Variant&lowbar;Union&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]::Variant&lowbar;Union
:relfileprefix: ../../../
:mrdocs:

Constructors

== Synopses

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

Create a `Variant&lowbar;Union` object having no active alternative&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-00.adoc[Variant&lowbar;Union]() = default;
----

[.small]#xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-00.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Union` object holding an object of type `t&lowbar;HEAD` direct&hyphen;initialized from the specified `args`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-0c.adoc[Variant&lowbar;Union](
    bsl::in&lowbar;place&lowbar;index&lowbar;t&lt;0&gt;,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-0c.adoc[_» more&period;&period;&period;_]#

Create a `Variant&lowbar;Union` object holding the alternative at index (template parameter) `t&lowbar;INDEX` in (template parameters) &apos;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;`, direct&hyphen;initialized from the specified `args&apos;&period; Note that `t&lowbar;INDEX` is not necessarily the absolute index of the desired alternative in the `bsl&colon;&colon;variant` object&period; We use the tag to &quot;unravel&quot; the union until we get to the desired alternative type&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    size&lowbar;t t&lowbar;INDEX,
    class&period;&period;&period; t&lowbar;ARGS&gt;
xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-07.adoc[Variant&lowbar;Union](
    bsl::in&lowbar;place&lowbar;index&lowbar;t&lt;t&lowbar;INDEX&gt;,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Variant_Union-0d/2constructor-07.adoc[_» more&period;&period;&period;_]#


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