[#beman-optional-optional-06-emplace]
= xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-06.adoc[optional&lt;T&&gt;]::emplace
:relfileprefix: ../../../
:mrdocs:

Converting copy assignment operator&period;

== Synopsis

Declared in `&lt;beman&sol;optional&sol;optional&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U&gt;
requires (std&colon;&colon;is&lowbar;constructible&lowbar;v&lt;T&amp;, U&gt; &amp;&amp; !detail&colon;&colon;reference&lowbar;constructs&lowbar;from&lowbar;temporary&lowbar;v&lt;T&amp;, U&gt;)
constexpr
T&
emplace(U&& u) noexcept(std&colon;&colon;is&lowbar;nothrow&lowbar;constructible&lowbar;v&lt;T &amp;, U&gt;);
----

== Description

If `rhs` has a value, assigns it to the stored value&period; Otherwise resets the stored value in `&ast;this`&period; If `T&amp;` can be constructed from a temporary, this assignment operator is deleted to prevent binding a temporary to a reference&period;

== Return Value

optional&amp;

== Template Parameters

[cols=2]
|===
| Name
| Description
| *U*
| 
|===

== Parameters

[cols=2]
|===
| Name
| Description
| *u*
| 
|===


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