Converting copy assignment operator.

Synopsis

Declared in <beman/optional/optional.hpp>

template<class U>
requires (std::is_constructible_v<T&, U> && !detail::reference_constructs_from_temporary_v<T&, U>)
constexpr
T&
emplace(U&& u) noexcept(std::is_nothrow_constructible_v<T &, U>);

Description

If rhs has a value, assigns it to the stored value. Otherwise resets the stored value in *this. If T& can be constructed from a temporary, this assignment operator is deleted to prevent binding a temporary to a reference.

Return Value

optional&

Template Parameters

Name

Description

U

Parameters

Name

Description

u

Created with MrDocs