[#BloombergLP-bdlb-Variant-operator_assign-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/Variant.adoc[Variant]::operator&equals;
:relfileprefix: ../../../
:mrdocs:

Assignment operators

== Synopses

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

Assign to this object the type and value currently held by the specified `rhs` object, and return a reference providing modifiable access to this object&period; The value currently held by this variant (if any) is destroyed if that value&apos;s type is not the same as the type held by the `rhs` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlb/Variant.adoc[Variant&lt;TYPES&period;&period;&period;&gt;]&
xref:BloombergLP/bdlb/Variant/operator_assign-0a.adoc[operator&equals;](xref:BloombergLP/bdlb/Variant.adoc[Variant] const& rhs);
----

[.small]#xref:BloombergLP/bdlb/Variant/operator_assign-0a.adoc[_» more&period;&period;&period;_]#

Assign to this object the type and value currently held by the specified `rhs` object, and return a reference providing modifiable access to this object&period; The value currently held by this variant (if any) is destroyed if that value&apos;s type is not the same as the type held by the `rhs` object&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp&lt;TYPES&gt;]&
xref:BloombergLP/bdlb/VariantImp/operator_assign-00.adoc[operator&equals;](xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp] const& rhs);
----

[.small]#xref:BloombergLP/bdlb/VariantImp/operator_assign-00.adoc[_» more&period;&period;&period;_]#

Assign to this object the type and value currently held by the specified `rhs` object, and return a reference providing modifiable access to this object&period; The value currently held by this variant (if any) is destroyed if that value&apos;s type is not the same as the type held by the `rhs` object&period; The contents of `rhs` are either move&hyphen;inserted into or move&hyphen;assigned to this object with `rhs` left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlb/Variant.adoc[Variant&lt;TYPES&period;&period;&period;&gt;]&
xref:BloombergLP/bdlb/Variant/operator_assign-02.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;Variant&gt;] rhs);
----

[.small]#xref:BloombergLP/bdlb/Variant/operator_assign-02.adoc[_» more&period;&period;&period;_]#

Assign to this object the type and value currently held by the specified `rhs` object, and return a reference providing modifiable access to this object&period; The contents of `rhs` are either move&hyphen;inserted into or move&hyphen;assigned to this object with `rhs` left in a valid but unspecified state&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp&lt;TYPES&gt;]&
xref:BloombergLP/bdlb/VariantImp/operator_assign-02.adoc[operator&equals;](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;VariantImp&gt;] rhs);
----

[.small]#xref:BloombergLP/bdlb/VariantImp/operator_assign-02.adoc[_» more&period;&period;&period;_]#

Assign to this object the specified `value` of template parameter `TYPE`, and return a reference providing modifiable access to this object&period; The value currently held by this variant (if any) is destroyed if that value&apos;s type is not the same as `TYPE`&period; `TYPE` must be the same as one of the types that this variant can hold&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
xref:BloombergLP/bdlb/Variant.adoc[Variant&lt;TYPES&period;&period;&period;&gt;]&
xref:BloombergLP/bdlb/Variant/operator_assign-0b.adoc[operator&equals;](TYPE const& value);
----

[.small]#xref:BloombergLP/bdlb/Variant/operator_assign-0b.adoc[_» more&period;&period;&period;_]#

Assign to this object the specified `value` of template parameter `TYPE`, and return a reference providing modifiable access to this object&period; The contents of `value` are moved to this object with `value` left in a valid but unspecified state&period; The value currently held by this variant (if any) is destroyed if that value&grave;s type is not the same as `TYPE`&period; `TYPE` must be the same as one of the types that this variant can hold&period; Note that in C&plus;&plus;11 mode, this method does not participate in overload resolution if it would lead to ambiguity with the move&hyphen;assignment operator (below)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
xref:BloombergLP/bdlb/Variant.adoc[Variant&lt;TYPES&period;&period;&period;&gt;]&
xref:BloombergLP/bdlb/Variant/operator_assign-05.adoc[operator&equals;](TYPE&& value)
requires !bsl&colon;&colon;is&lowbar;same&lt;SelfType,
                      typename bsl&colon;&colon;remove&lowbar;cvref&lt;TYPE&gt;&colon;&colon;type&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdlb/Variant/operator_assign-05.adoc[_» more&period;&period;&period;_]#


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