[#BloombergLP-bslstl-Variant_Union-0d-2constructor-07]
= 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:

Create a `Variant&lowbar;Union` object holding the alternative at index (template parameter) `t&lowbar;INDEX`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    size&lowbar;t t&lowbar;INDEX,
    class&period;&period;&period; t&lowbar;ARGS&gt;
Variant&lowbar;Union(
    bsl::in&lowbar;place&lowbar;index&lowbar;t&lt;t&lowbar;INDEX&gt; inPlaceIndex,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

== Description

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;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *inPlaceIndex*
| tag selecting the alternative at index `t&lowbar;INDEX`
| *args*
| arguments forwarded to the alternative&apos;s constructor
|===


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