[#BloombergLP-bslstl-Optional_Base-05-emplace-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional&lowbar;Base]::emplace
:relfileprefix: ../../../
:mrdocs:

Destroy any contained value and construct a new one in place&period;

== Synopses

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

Destroy any contained value and construct a new one in place&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class&period;&period;&period; t&lowbar;ARGS&gt;
t&lowbar;TYPE&
xref:BloombergLP/bslstl/Optional_Base-05/emplace-0f.adoc[emplace](t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/emplace-0f.adoc[_» more&period;&period;&period;_]#

Destroy any contained value and construct a new one in place&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INIT&lowbar;LIST&lowbar;TYPE,
    class&period;&period;&period; t&lowbar;ARGS&gt;
t&lowbar;TYPE&
xref:BloombergLP/bslstl/Optional_Base-05/emplace-0c.adoc[emplace](
    std::initializer&lowbar;list&lt;t&lowbar;INIT&lowbar;LIST&lowbar;TYPE&gt; il,
    t&lowbar;ARGS&&&period;&period;&period; args);
----

[.small]#xref:BloombergLP/bslstl/Optional_Base-05/emplace-0c.adoc[_» more&period;&period;&period;_]#

== Return Value

reference providing modifiable access to the contained value

== Parameters

[cols="1,4"]
|===
| Name| Description
| *args*
| arguments forwarded to construct the contained value
| *il*
| initializer list forwarded to construct the contained value
|===


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