Assigns the stored value from rhs if it has one, destroying the old value if there

Synopsis

Declared in <beman/optional/optional.hpp>

template<class U>
constexpr
optional<T>&
operator=(optional<U> const& rhs)
requires (detail::enable_assign_from_other<T, U, const U&>);

Description

Converting copy assignment operator.

Copies the value from rhs if there is one. Otherwise resets the stored value in *this.

Return Value

Reference to the current object

Created with MrDocs