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 neither t_TYPE nor t_ANY_TYPE is allocator-aware.

Synopsis

Declared in <bslstl_optional.h>

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