libycxx

constructor · 12 overloads

std::optional::optional

Scope
std::optional

Constructors

Overloads

  1. constexpr optional() noexcept;
    (1)
  2. constexpr optional(
        const optional& other) = default  requires is_copy_constructible_v<T> && is_trivially_copy_constructible_v<T>;
    (2)
  3. constexpr optional(const optional& other) = delete  requires (!is_copy_constructible_v<T>);
    (3)
  4. constexpr optional(
        const optional& rhs)  requires is_copy_constructible_v<T> && (!is_trivially_copy_constructible_v<T>);
    (4)
  5. template<class U>
      requires (!is_same_v<U, T>) && is_constructible_v<T, const U&> &&
                (is_same_v<remove_cv_t<T>, bool> || !converts-from-any-cvref<T, optional<U>>)
    explicit(!is_convertible_v<const U &, T>) constexpr optional(const optional<U>& rhs);
    (5)
  6. constexpr optional(
        optional&& other) = default  requires is_move_constructible_v<T> && is_trivially_move_constructible_v<T>;
    (6)
  7. constexpr optional(
        optional&& rhs) noexcept(is_nothrow_move_constructible_v<T>)  requires is_move_constructible_v<T> && (!is_trivially_move_constructible_v<T>);
    (7)
  8. template<class U>
      requires (!is_same_v<U, T>) && is_constructible_v<T, U> &&
                (is_same_v<remove_cv_t<T>, bool> || !converts-from-any-cvref<T, optional<U>>)
    explicit(!is_convertible_v<U, T>) constexpr optional(optional<U>&& rhs);
    (8)
  9. constexpr optional(nullopt_t value) noexcept;
    (9)
  10. template<class U = remove_cv_t<T>>
      requires (!is_same_v<remove_cvref_t<U>, in_place_t>) && (!is_same_v<remove_cvref_t<U>, optional>) &&
                (!is_same_v<remove_cv_t<T>, bool> || !is-optional<remove_cvref_t<U>>) &&
                is_constructible_v<T, U>
    explicit(!is_convertible_v<U, T>) constexpr optional(U&& v);
    (10)
  11. template<class... Args>
      requires is_constructible_v<T, Args...>
    explicit constexpr optional(in_place_t, Args&&... args);
    (11)
  12. template<class U, class... Args>
      requires is_constructible_v<T, initializer_list<U>&, Args...>
    explicit constexpr optional(
        in_place_t,
        initializer_list<U> il,
        Args&&... args);
    (12)