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.

Assign a new value to this optional.

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

Assign a new value to this optional.

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

Assign a new value to this optional.

Assign a new value to this optional.

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);

Assign a new value to this optional.

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

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);

Return Value

reference providing modifiable access to this object

Parameters

Name

Description

rhs

right‐hand operand

nullopt

disengaged‐optional tag; value is unused

Created with MrDocs