beman::optional::optional::operator=

Copy assigns the value from rhs if it has one.

Synopsis

Declared in <beman/optional/optional.hpp>

constexpr
optional<T>&
operator=(optional const& rhs)
requires std::is_copy_constructible_v<T> && std::is_copy_assignable_v<T> &&
             (!std::is_trivially_copy_assignable_v<T>);

Return Value

Reference to the current object

Parameters

NameDescription
rhsThe object to copy assign from