[#BloombergLP-bdlb-Variant5-assign]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/Variant5.adoc[Variant5]::assign
:relfileprefix: ../../../
:mrdocs:

`assign` overloads

== Synopses

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

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/VariantImp.adoc[VariantImp&lt;TYPES&gt;]&
xref:BloombergLP/bdlb/VariantImp/assign-06.adoc[assign](TYPE const& value);
----

[.small]#xref:BloombergLP/bdlb/VariantImp/assign-06.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;


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

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


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