[#BloombergLP-bslstl-Optional_Base-05-operator_assign-08] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base]::operator= :relfileprefix: ../../../ :mrdocs: Assign a new value to this optional. == Synopsis Declared in `<bslstl_optional.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>]& operator=(xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<Optional_Base>] rhs); ---- == Description Assign to this object the value of the specified `rhs` object, and return a non‐`const` reference to this object. The allocators of this object and `rhs` both remain unchanged. The contents of `rhs` are either move‐constructed into or move‐assigned to this object. `rhs` is left in a valid but unspecified state. == Return Value reference providing modifiable access to this object == Parameters [cols="1,4"] |=== | Name| Description | *rhs* | right‐hand operand |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#