[#BloombergLP-bdlb-VariantImp-assignTo]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp]::assignTo
:relfileprefix: ../../../
:mrdocs:

Assign `value` converted to `TYPE` 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,
    class SOURCE&lowbar;TYPE&gt;
xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp&lt;TYPES&gt;]&
assignTo(SOURCE&lowbar;TYPE const& value);
----

== Description

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 and `SOURCE&lowbar;TYPE` must be convertible to `TYPE`&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]#
