[#bsl-optional-072-operator_assign-0e]
= xref:bsl.adoc[bsl]::xref:bsl/optional-072.adoc[optional]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Disengage this object if the specified `rhs` object is disengaged, and move assign to this object the value of `rhs&period;value()` (of `t&lowbar;ANY&lowbar;TYPE`) converted to `t&lowbar;TYPE` otherwise&period; Return a reference providing modifiable access to this object&period; Note that this method does not participate in overload resolution unless `t&lowbar;TYPE` and `t&lowbar;ANY&lowbar;TYPE` are compatible&period; This assignment operator can be called in constant expressions only when `t&lowbar;TYPE` is not allocator&hyphen;aware&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 = t&lowbar;TYPE&gt;
constexpr
xref:bsl/optional-072.adoc[optional&lt;t&lowbar;TYPE&gt;]&
operator&equals;(std::optional&lt;t&lowbar;ANY&lowbar;TYPE&gt;&& rhs);
----


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