[#BloombergLP-bslstl-Variant_Base-2constructor-04]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base]::Variant&lowbar;Base
:relfileprefix: ../../../
:mrdocs:

Create a `Variant&lowbar;Base` object holding the alternative with index (template parameter) `t&lowbar;INDEX`, direct&hyphen;initialized from the specified `args`&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;
explicit
Variant&lowbar;Base(
    std::allocator&lowbar;arg&lowbar;t allocatorArg,
    xref:BloombergLP/bslstl/Variant_Base/allocator_type.adoc[allocator&lowbar;type] allocator,
    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;Base` object holding the alternative with index (template parameter) `t&lowbar;INDEX`, direct&hyphen;initialized from the specified `args`&period; If this `Variant&lowbar;Base` is allocator&hyphen;aware, the specified `allocator` is used to supply memory&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *allocatorArg*
| tag selecting the allocator&hyphen;extended overload
| *allocator*
| allocator used to supply memory
| *inPlaceIndex*
| tag selecting the in&hyphen;place&hyphen;index constructor
| *args*
| arguments forwarded to the alternative&apos;s constructor
|===


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