[#bsl-variant-operator_assign-07]
= xref:bsl.adoc[bsl]::xref:bsl/variant.adoc[variant]::operator&equals;
:relfileprefix: ../../
:mrdocs:

Assignment operators

== Synopses

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

Assign to this object a copy of `rhs`&apos;s alternative&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/variant.adoc[variant]&
xref:bsl/variant/operator_assign-03.adoc[operator&equals;](xref:bsl/variant.adoc[variant] const& rhs) = default;
----

[.small]#xref:bsl/variant/operator_assign-03.adoc[_» more&period;&period;&period;_]#

Assign to this object a moved copy of `rhs`&apos;s alternative&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/variant.adoc[variant]&
xref:bsl/variant/operator_assign-0a.adoc[operator&equals;](xref:bsl/variant.adoc[variant]&& rhs) = default;
----

[.small]#xref:bsl/variant/operator_assign-0a.adoc[_» more&period;&period;&period;_]#

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


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;TYPE&gt;
xref:bsl/variant.adoc[variant]&
xref:bsl/variant/operator_assign-00.adoc[operator&equals;](t&lowbar;TYPE&& value)
requires BloombergLP&colon;&colon;bslstl&colon;&colon;Variant&lowbar;AssignsFromType&lt;variant, t&lowbar;TYPE&gt;&colon;&colon;value;
----

[.small]#xref:bsl/variant/operator_assign-00.adoc[_» more&period;&period;&period;_]#

== Return Value

reference to this object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *rhs*
| variant to copy from
| *value*
| value to assign to the selected alternative
|===


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