Emplaces a new value in the optional, destroying the current one if

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

Constructs the stored value from u if it is convertible to T&.

Return Value

T&

Created with MrDocs