Constructors
Synopses
Declared in <beman/optional/optional.hpp>
Default constructs an empty optional.
constexpr
optional() noexcept;
Copy constructs the value from rhs
if it has one.
Copy constructs the value from rhs
if it has one.
Constructs the value from rhs
if it has one.
template<class U>
constexpr
optional(optional<U> const& rhs)
requires (detail::enable_from_other<T, U, const U&>);
Move constructs the value from rhs
if it has one.
Move constructs the value from rhs
if it has one.
Constructs the value from rhs
if it has one.
template<class U>
constexpr
optional(optional<U>&& rhs)
requires (detail::enable_from_other<T, U, U &&>);
Constructs an empty optional.
constexpr
optional(nullopt_t value) noexcept;
Constructs the value from u,
forwarding it if necessary.
template<class U = T>
constexpr
optional(U&& u)
requires detail::enable_forward_value<T, U>;
Constructs the value in‐place using the given arguments.
template<class... Args>
constexpr
optional(
in_place_t,
Args...&&... args)
requires std::is_constructible_v<T, Args...>;
Constructs the value in‐place using the given arguments.
template<
class U,
class... Args>
constexpr
optional(
in_place_t,
std::initializer_list<U> il,
Args...&&... args)
requires std::is_constructible_v<T, std::initializer_list<U>&, Args&&...>;
Template Parameters
Name |
Description |
U |
Created with MrDocs