[#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 stored value. Otherwise resets the stored value in `*this`. == Return Value optional& [.small]#Created with https://www.mrdocs.com[MrDocs]#