bsl::optional::operator=

Assignment operators

Synopses

Declared in <bslstl_optional.h>

Assign to this object the value of the specified rhs object, and return a non-const reference to this object.

Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>&
operator=(Optional_Base const& rhs);
» more...

Assign a new value to this optional.

template<class t_ANY_TYPE>
constexpr
optional<t_TYPE>&
operator=(optional<t_ANY_TYPE> const& rhs);
» more...

Assign a new value to this optional.

constexpr
optional<t_TYPE>&
operator=(bsl::nullopt_t nullopt) noexcept;
» more...

Assign a new value to this optional.

Optional_Base<t_TYPE, t_USES_BSLMA_ALLOC>&
operator=(BloombergLP::bslmf::MovableRef<Optional_Base> rhs);
» more...

Assign a new value to this optional.

template<class t_ANY_TYPE>
constexpr
optional<t_TYPE>&
operator=(BloombergLP::bslmf::MovableRef_Deduced<optional<t_ANY_TYPE>> rhs);
» more...

Assign a new value to this optional.

template<class t_ANY_TYPE = t_TYPE>
constexpr
optional<t_TYPE>&
operator=(std::optional<t_ANY_TYPE> const& rhs);
» more...

Assign a new value to this optional.

template<class t_ANY_TYPE = t_TYPE>
constexpr
optional<t_TYPE>&
operator=(t_ANY_TYPE&& rhs);
» more...

Assign a new value to this optional.

template<class t_ANY_TYPE = t_TYPE>
constexpr
optional<t_TYPE>&
operator=(std::optional<t_ANY_TYPE>&& rhs);
» more...

Return Value

reference providing modifiable access to this object

Parameters

NameDescription
rhsright-hand operand
nulloptdisengaged-optional tag; value is unused