bsl::optional::operator=

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.

Synopsis

Declared in <bslstl_optional.h>

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