[#beman-optional-optional-03-operator_assign-07]
= 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 `rhs` if it has one, 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&gt;
constexpr
xref:beman/optional/optional-03.adoc[optional&lt;T&gt;]&
operator&equals;(xref:beman/optional/optional-03.adoc[optional&lt;U&gt;]&& rhs)
requires (detail&colon;&colon;enable&lowbar;assign&lowbar;from&lowbar;other&lt;T, U, U&gt;);
----

== Description

Converting move assignment operator&period;

Moves the value from `rhs` if there is one&period; Otherwise resets the contained value in `&ast;this`&period;

== Return Value

`&ast;this`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| The optional to assign from&period;
|===


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