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

Assign the specified `TYPE` `value` to this object&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
xref:BloombergLP/bdlb/Variant2.adoc[Variant2&lt;A1, A2&gt;]&
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;
----

== Description

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;

== Return Value

reference providing modifiable access to this object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *value*
| value assigned to or stored in this variant
|===


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