[#BloombergLP-bdlb-NullableValue-operator_assign-087] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue]::operator= :relfileprefix: ../../../ :mrdocs: Assignment operators == Synopses Declared in `<bdlb_nullablevalue.h>` Assign to this object the value of the specified `rhs`, and return a reference providing modifiable access to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-038.adoc[operator=](xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue] const& rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-038.adoc[_» more..._]# Assign to this object the value of the specified `rhs` object, and return a non‐`const` reference to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>]& xref:BloombergLP/bslstl/Optional_Base-05/operator_assign-05.adoc[operator=](xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base] const& rhs); ---- [.small]#xref:BloombergLP/bslstl/Optional_Base-05/operator_assign-05.adoc[_» more..._]# Assign to this object the null value if the specified `rhs` object is null, and the value of `rhs.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE' are not compatible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-00b.adoc[operator=](xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<BDE_OTHER_TYPE>] const& rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-00b.adoc[_» more..._]# Disengage this object if the specified `rhs` object is disengaged, and assign to this object the value of `rhs.value()` (of `t_ANY_TYPE`) converted to `t_TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless `t_TYPE` and `t_ANY_TYPE` are compatible. This assignment operator can be called in constant expressions only when neither `t_TYPE` nor `t_ANY_TYPE` is allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-08.adoc[operator=](xref:bsl/optional-072.adoc[optional<t_ANY_TYPE>] const& rhs); ---- [.small]#xref:bsl/optional-072/operator_assign-08.adoc[_» more..._]# Reset this object to be disengaged and return a reference providing modifiable access to this object. This assignment operator can be called in constant expressions only when `t_TYPE` is not allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-09.adoc[operator=](xref:bsl/nullopt_t.adoc[bsl::nullopt_t]) noexcept; ---- [.small]#xref:bsl/optional-072/operator_assign-09.adoc[_» more..._]# Assign to this object the value of the specified `rhs`, 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. `rhs` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-08f.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<NullableValue>] rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-08f.adoc[_» more..._]# Assign to this object the value of the specified `rhs`, 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. `rhs` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-0f.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<TYPE>] rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-0f.adoc[_» more..._]# Assign to this object the value of the specified `rhs` object, and return a non‐`const` reference to this object. The allocators of this object and `rhs` both remain unchanged. The contents of `rhs` are either move‐constructed into or move‐assigned to this object. `rhs` is left in a valid but unspecified state. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bslstl/Optional_Base-05.adoc[Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>]& xref:BloombergLP/bslstl/Optional_Base-05/operator_assign-08.adoc[operator=](xref:BloombergLP/bslmf/MovableRef.adoc[BloombergLP::bslmf::MovableRef<Optional_Base>] rhs); ---- [.small]#xref:BloombergLP/bslstl/Optional_Base-05/operator_assign-08.adoc[_» more..._]# Assign to this object the value of the specified `rhs`, and return a reference providing modifiable access to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-05f.adoc[operator=](TYPE const& rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-05f.adoc[_» more..._]# Reset this object to the default constructed state (i.e., to have the null value), and return a reference providing modifiable access to this object. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-07.adoc[operator=](xref:bsl/nullopt_t.adoc[bsl::nullopt_t] const&) noexcept; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-07.adoc[_» more..._]# Assign to this object the null value if the specified `rhs` object is null, and the value of `rhs.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE' are not compatible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-034.adoc[operator=](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<NullableValue<BDE_OTHER_TYPE>>] rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-034.adoc[_» more..._]# Disengage this object if the specified `rhs` object is disengaged, and move assign to this object the value of `rhs.value()` (of `t_ANY_TYPE`) converted to `t_TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless `t_TYPE` and `t_ANY_TYPE` are compatible. This assignment operator can be called in constant expressions only when neither `t_TYPE` nor `t_ANY_TYPE` is allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-0f.adoc[operator=](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<optional<t_ANY_TYPE>>] rhs); ---- [.small]#xref:bsl/optional-072/operator_assign-0f.adoc[_» more..._]# Assign to this object the null value if the specified `rhs` object is null, and the value of `rhs.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE' are not compatible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-002.adoc[operator=](xref:BloombergLP/bslmf/MovableRef_Deduced.adoc[BloombergLP::bslmf::MovableRef_Deduced<bsl::optional<BDE_OTHER_TYPE>>] rhs) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-002.adoc[_» more..._]# Assign to this object the value of the specified `rhs` object (of `BDE_OTHER_TYPE`) converted to `TYPE`, and return a reference providing modifiable access to this object. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE` are not compatible. Note that on C++03 but not in C++11 and beyond, if `BDE_OTHER_TYPE` is `bslmf::MovableRef<TYPE3>` and `TYPE` supports moves and/or assigns from that type, a move rather than a copy may take place. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-039.adoc[operator=](BDE_OTHER_TYPE const& rhs); ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-039.adoc[_» more..._]# Assign to this object the null value if the specified `rhs` object is null, and the value of `rhs.value()` (of `BDE_OTHER_TYPE`) converted to `TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method will fail to compile if `TYPE` and `BDE_OTHER_TYPE' are not compatible. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class BDE_OTHER_TYPE> xref:BloombergLP/bdlb/NullableValue.adoc[NullableValue<TYPE>]& xref:BloombergLP/bdlb/NullableValue/operator_assign-054.adoc[operator=](xref:bsl/optional-072.adoc[bsl::optional<BDE_OTHER_TYPE>] const& rhs) requires bsl::is_convertible<BDE_OTHER_TYPE, TYPE>::value; ---- [.small]#xref:BloombergLP/bdlb/NullableValue/operator_assign-054.adoc[_» more..._]# Disengage this object if the specified `rhs` object is disengaged, and assign to this object the value of `rhs.value()` (of `t_ANY_TYPE`) converted to `t_TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless `t_TYPE` and `t_ANY_TYPE` are compatible. This assignment operator can be called in constant expressions only when `t_TYPE` is not allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE = t_TYPE> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-06.adoc[operator=](std::optional<t_ANY_TYPE> const& rhs); ---- [.small]#xref:bsl/optional-072/operator_assign-06.adoc[_» more..._]# Assign to this object the value of the specified `rhs` object converted to `t_TYPE`, and return a reference providing modifiable access to this object. Note that this method may invoke assignment from `rhs`, or construction from `rhs`, depending on whether this object is engaged. This assignment operator does not participate in overload resolution if `t_ANY_TYPE` is possibly cv‐qualified `bsl::optional<t_TYPE>`. Also note that an assignment of the form `o = {};`, where `o` is of type `optional`, will always assign to `o` the empty state, and never call this overload (see implementation notes). This assignment operator can be called in constant expressions only when `t_TYPE` is not allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE = t_TYPE> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-0d.adoc[operator=](t_ANY_TYPE&& rhs); ---- [.small]#xref:bsl/optional-072/operator_assign-0d.adoc[_» more..._]# Disengage this object if the specified `rhs` object is disengaged, and move assign to this object the value of `rhs.value()` (of `t_ANY_TYPE`) converted to `t_TYPE` otherwise. Return a reference providing modifiable access to this object. Note that this method does not participate in overload resolution unless `t_TYPE` and `t_ANY_TYPE` are compatible. This assignment operator can be called in constant expressions only when `t_TYPE` is not allocator‐aware. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_ANY_TYPE = t_TYPE> constexpr xref:bsl/optional-072.adoc[optional<t_TYPE>]& xref:bsl/optional-072/operator_assign-0e.adoc[operator=](std::optional<t_ANY_TYPE>&& rhs); ---- [.small]#xref:bsl/optional-072/operator_assign-0e.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#