libycxx

constructor · 14 overloads

std::optional<T&>::optional

Scope
std::optional<T&>
cppreference
<optional> nearest page

Constructors

Overloads

  1. constexpr optional() noexcept = default;
    (1)
  2. constexpr optional(const optional& rhs) noexcept = default;
    (2)
  3. constexpr optional(nullopt_t value) noexcept;
    (3)
  4. template<class U>
      requires from-opt<U> && is_constructible_v<T&, U&> && reference_constructs_from_temporary_v<T&, U&>
    explicit(!is_convertible_v<U &, T &>) constexpr optional(
        optional<U>& value) noexcept(is_nothrow_constructible_v<T &, U &>) = delete;
    (4)
  5. template<class U>
      requires from-opt<U> && is_constructible_v<T&, U&> && (!reference_constructs_from_temporary_v<T&, U&>)
    explicit(!is_convertible_v<U &, T &>) constexpr optional(
        optional<U>& rhs) noexcept(is_nothrow_constructible_v<T &, U &>);
    (5)
  6. template<class U>
      requires from-opt<U> && is_constructible_v<T&, const U&> && reference_constructs_from_temporary_v<T&, const U&>
    explicit(!is_convertible_v<const U &, T &>) constexpr optional(
        const optional<U>& value) noexcept(is_nothrow_constructible_v<T &, const U &>) = delete;
    (6)
  7. template<class U>
      requires from-opt<U> && is_constructible_v<T&, const U&> && (!reference_constructs_from_temporary_v<T&, const U&>)
    explicit(!is_convertible_v<const U &, T &>) constexpr optional(
        const optional<U>& rhs) noexcept(is_nothrow_constructible_v<T &, const U &>);
    (7)
  8. template<class U>
      requires (!is_same_v<remove_cvref_t<U>, optional>) && (!is_same_v<remove_cvref_t<U>, in_place_t>) &&
                is_constructible_v<T&, U> && (!reference_constructs_from_temporary_v<T&, U>)
    explicit(!is_convertible_v<U, T &>) constexpr optional(
        U&& u) noexcept(is_nothrow_constructible_v<T &, U>);
    (8)
  9. template<class U>
      requires (!is_same_v<remove_cvref_t<U>, optional>) && (!is_same_v<remove_cvref_t<U>, in_place_t>) &&
                is_constructible_v<T&, U> && reference_constructs_from_temporary_v<T&, U>
    explicit(!is_convertible_v<U, T &>) constexpr optional(
        U&& u) noexcept(is_nothrow_constructible_v<T &, U>) = delete;
    (9)
  10. template<class U>
      requires from-opt<U> && is_constructible_v<T&, U> && reference_constructs_from_temporary_v<T&, U>
    explicit(!is_convertible_v<U, T &>) constexpr optional(
        optional<U>&& value) noexcept(is_nothrow_constructible_v<T &, U>) = delete;
    (10)
  11. template<class U>
      requires from-opt<U> && is_constructible_v<T&, U> && (!reference_constructs_from_temporary_v<T&, U>)
    explicit(!is_convertible_v<U, T &>) constexpr optional(
        optional<U>&& rhs) noexcept(is_nothrow_constructible_v<T &, U>);
    (11)
  12. template<class U>
      requires from-opt<U> && is_constructible_v<T&, const U> && reference_constructs_from_temporary_v<T&, const U>
    explicit(!is_convertible_v<const U, T &>) constexpr optional(
        const optional<U>&& value) noexcept(is_nothrow_constructible_v<T &, const U>) = delete;
    (12)
  13. template<class U>
      requires from-opt<U> && is_constructible_v<T&, const U> && (!reference_constructs_from_temporary_v<T&, const U>)
    explicit(!is_convertible_v<const U, T &>) constexpr optional(
        const optional<U>&& rhs) noexcept(is_nothrow_constructible_v<T &, const U>);
    (13)
  14. template<class Arg>
      requires is_constructible_v<T&, Arg> && (!reference_constructs_from_temporary_v<T&, Arg>)
    explicit constexpr optional(in_place_t, Arg&& arg);
    (14)