[#beman-optional-optional-03-operator_assign-0b]
= xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-03.adoc[optional]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

Assigns the contained value from `u,` destroying the old value if there

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class U = T&gt;
constexpr
xref:beman/optional/optional-03.adoc[optional&lt;T&gt;]&
operator&equals;(U&& u)
requires detail&colon;&colon;enable&lowbar;assign&lowbar;forward&lt;T, U&gt;;
----

== Description

Assigns the contained value from `u`, destroying the old value if there was one&period;

== Return Value

optional&amp;

== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *U*
| The type of the value to assign&period;
|===

== Parameters

[cols="1,4"]
|===
| Name| Description
| *u*
| The value to assign&period;
|===


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