[#BloombergLP-bslstl-Optional_Base-08-assignOrEmplace]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-08.adoc[Optional&lowbar;Base&lt;t&lowbar;TYPE, false&gt;]::assignOrEmplace
:relfileprefix: ../../../
:mrdocs:

If `&ast;this` holds an object, assign to that object the value of the specified `rhs`, converted to `t&lowbar;TYPE`&period; Otherwise, construct a held object from `rhs`, converted to `t&lowbar;TYPE`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;ANY&lowbar;TYPE&gt;
constexpr
void
assignOrEmplace(t&lowbar;ANY&lowbar;TYPE&& rhs);
----


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