[#BloombergLP-bslstl-Variant_Base-operator_assign-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

If the specified `rhs` holds the same alternative type as this object, move assign the contained value of `rhs` to the contained value of this object&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;variant&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bslstl/Variant_Base.adoc[Variant&lowbar;Base&lt;t&lowbar;HEAD, t&lowbar;TAIL&period;&period;&period;&gt;]&
operator&equals;(xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef&lt;Variant&lowbar;Base&gt;] rhs);
----

== Description

If the specified `rhs` holds the same alternative type as this object, move assign the contained value of `rhs` to the contained value of this object&period; Otherwise, destroy the currently held alternative object (if any) and, if `rhs` holds a value, move&hyphen;construct the corresponding alternative of this object from the contained value of `rhs`&period; The allocators of this object and `rhs` both remain unchanged&period; If the construction of a new alternative object exits via an exception, this `Variant&lowbar;Base` object is left in a valueless by exception state&period; All alternatives shall be move constructible and move assignable&period;

== Return Value

reference to this object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| object to assign from
|===


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