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

Create the alternative with index (template parameter) `t&lowbar;INDEX` in place, 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;
void
baseEmplace(t&lowbar;ARGS&&&period;&period;&period; args);
----

== Description

Create the alternative with index (template parameter) `t&lowbar;INDEX` in place, direct&hyphen;initialized from the specified `args`&period; If this `Variant&lowbar;Base` object already holds a value, that contained value is destroyed before the new object is created&period; If the alternative is allocator&hyphen;aware, it uses the allocator specified upon the construction of this `Variant&lowbar;Base` object to supply memory&semi; passing an allocator argument to this method results in two allocators being passed to the alternative constructor, resulting in a likely compilation error&period; Note that if the constructor of the alternative exits via an exception, this object is left in the valueless by exception state&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *args*
| arguments forwarded to the alternative&apos;s constructor
|===


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