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

Assignment operator&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr
xref:beman/optional/optional-06.adoc[optional]&
operator&equals;(xref:beman/optional/optional-06.adoc[optional] const& rhs) noexcept = default;
----

== Description

If `rhs` has a value, assigns it to the contained value&period; Otherwise resets the contained value in `&ast;this`&period;

== Return Value

optional&amp;

== Parameters

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


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