Constructs the value from u, forwarding it if necessary.

Synopsis

Declared in <beman/optional/optional.hpp>

template<class U = T>
constexpr
explicit(!std::is_convertible_v<U, T>)
optional(U&& u)
requires detail::enable_forward_value<T, U>;

Description

If u is convertible to T, this is an explicit constructor.

Constructs the stored value with u.

Parameters

Name

Description

u

The object to move construct from

Created with MrDocs