beman::optional::make_optional

Make an optional

Synopsis

Declared in <beman/optional/optional.hpp>

template<
    int = 0,
    class T>
constexpr
optional<std::decay_t<T>>
make_optional(T&& t) noexcept(/* see-below */)
requires std::is_constructible_v<std::decay_t<T>, T>;

Exception specification

This function is potentially-throwing unless std::is_nothrow_constructible_v<optional<std::decay_t<T>>, T>.

Return Value

Optional Objects