beman::optional::optional::optional

Constructors

Synopses

Declared in <beman/optional/optional.hpp>

Default constructs an empty optional.

constexpr
optional() noexcept;
» more...

Copy constructs the value from rhs if it has one.

constexpr
optional(optional const& other)
requires std::is_copy_constructible_v<T> && std::is_trivially_copy_constructible_v<T> = default;
» more...

Copy constructs the value from rhs if it has one.

constexpr
optional(optional const& rhs)
requires std::is_copy_constructible_v<T> && (!std::is_trivially_copy_constructible_v<T>);
» more...

Constructs the value from rhs if it has one.

template<class U>
constexpr
explicit(!std::is_convertible_v<U, T>)
optional(optional<U> const& rhs)
requires (detail::enable_from_other<T, U, const U&>);
» more...

Move constructs the value from rhs if it has one.

constexpr
optional(optional&& other)
requires std::is_move_constructible_v<T> && std::is_trivially_move_constructible_v<T> = default;
» more...

Move constructs the value from rhs if it has one.

constexpr
optional(optional&& rhs) noexcept(std::is_nothrow_move_constructible_v<T>)
requires std::is_move_constructible_v<T> && (!std::is_trivially_move_constructible_v<T>);
» more...

Constructs the value from rhs if it has one.

template<class U>
constexpr
explicit(!std::is_convertible_v<U, T>)
optional(optional<U>&& rhs)
requires (detail::enable_from_other<T, U, U &&>);
» more...

Constructs an empty optional.

constexpr
optional(nullopt_t value) noexcept;
» more...

Constructs the value from u, forwarding it if necessary.

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

Constructs the value in-place using the given arguments.

template<class... Args>
constexpr
explicit
optional(
    in_place_t,
    Args...&&... args)
requires std::is_constructible_v<T, Args...>;
» more...

Constructs the value in-place using the given arguments.

template<
    class U,
    class... Args>
constexpr
explicit
optional(
    in_place_t,
    std::initializer_list<U> il,
    Args...&&... args)
requires std::is_constructible_v<T, std::initializer_list<U>&, Args&&...>;
» more...

Created with MrDocs