[#beman-optional-optional-06-operator_assign-04] = xref:beman.adoc[beman]::xref:beman/optional.adoc[optional]::xref:beman/optional/optional-06.adoc[optional<T&>]::operator= :relfileprefix: ../../../ :mrdocs: Assignment operator. == Synopsis Declared in `<beman/optional/optional.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:beman/optional/optional-06.adoc[optional]& operator=(xref:beman/optional/optional-06.adoc[optional] const& rhs) noexcept = default; ---- == Description If `rhs` has a value, assigns it to the contained value. Otherwise resets the contained value in `*this`. == Return Value optional& == Parameters [cols="1,4"] |=== |Name|Description | *rhs* | The value to assign. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#