[#BloombergLP-bdlb-Variant14-operator_assign-08d1] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/Variant14.adoc[Variant14]::operator= :relfileprefix: ../../../ :mrdocs: Assignment operators == Synopses Declared in `<bdlb_variant.h>` 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. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the `rhs` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant14.adoc[Variant14<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>]& xref:BloombergLP/bdlb/Variant14/operator_assign-0a.adoc[operator=](xref:BloombergLP/bdlb/Variant14.adoc[Variant14] const& rhs); ---- [.small]#xref:BloombergLP/bdlb/Variant14/operator_assign-0a.adoc[_» more..._]# 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. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the `rhs` object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp<TYPES>]& xref:BloombergLP/bdlb/VariantImp/operator_assign-00.adoc[operator=](xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp] const& rhs); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/operator_assign-00.adoc[_» more..._]# 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. The value currently held by this variant (if any) is destroyed if that value's type is not the same as the type held by the `rhs` object. The contents of `rhs` are either move‐inserted into or move‐assigned to this object with `rhs` left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/Variant14.adoc[Variant14<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>]& xref:BloombergLP/bdlb/Variant14/operator_assign-01.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Variant14>] rhs); ---- [.small]#xref:BloombergLP/bdlb/Variant14/operator_assign-01.adoc[_» more..._]# 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. The contents of `rhs` are either move‐inserted into or move‐assigned to this object with `rhs` left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/VariantImp.adoc[VariantImp<TYPES>]& xref:BloombergLP/bdlb/VariantImp/operator_assign-02.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<VariantImp>] rhs); ---- [.small]#xref:BloombergLP/bdlb/VariantImp/operator_assign-02.adoc[_» more..._]# Assign to this object the specified `value` of template parameter `TYPE`, and return a reference providing modifiable access to this object. The value currently held by this variant (if any) is destroyed if that value's type is not the same as `TYPE`. `TYPE` must be the same as one of the types that this variant can hold. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> xref:BloombergLP/bdlb/Variant14.adoc[Variant14<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>]& xref:BloombergLP/bdlb/Variant14/operator_assign-08d2.adoc[operator=](TYPE const& value); ---- [.small]#xref:BloombergLP/bdlb/Variant14/operator_assign-08d2.adoc[_» more..._]# Assign to this object the specified `value` of template parameter `TYPE`, and return a reference providing modifiable access to this object. The contents of `value` are moved to this object with `value` left in a valid but unspecified state. The value currently held by this variant (if any) is destroyed if that value`s type is not the same as `TYPE`. `TYPE` must be the same as one of the types that this variant can hold. Note that in C++11 mode, this method does not participate in overload resolution if it would lead to ambiguity with the move‐assignment operator (below). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> xref:BloombergLP/bdlb/Variant14.adoc[Variant14<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14>]& xref:BloombergLP/bdlb/Variant14/operator_assign-05.adoc[operator=](TYPE&& value) requires !bsl::is_same<SelfType, typename bsl::remove_cvref<TYPE>::type>::value; ---- [.small]#xref:BloombergLP/bdlb/Variant14/operator_assign-05.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#