Lines Matching refs:optional

2 //===-------------------------- optional ----------------------------------===//
14 optional synopsis
19 // 23.6.3, optional for object types
20 template <class T> class optional;
31 constexpr bool operator==(const optional<T>&, const optional<U>&);
33 constexpr bool operator!=(const optional<T>&, const optional<U>&);
35 constexpr bool operator<(const optional<T>&, const optional<U>&);
37 constexpr bool operator>(const optional<T>&, const optional<U>&);
39 constexpr bool operator<=(const optional<T>&, const optional<U>&);
41 constexpr bool operator>=(const optional<T>&, const optional<U>&);
44 template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
45 template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
46 template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
47 template <class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept;
48 template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
49 template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
50 template <class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept;
51 template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept;
52 template <class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept;
53 template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept;
54 template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
55 template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
58 template <class T, class U> constexpr bool operator==(const optional<T>&, const U&);
59 template <class T, class U> constexpr bool operator==(const T&, const optional<U>&);
60 template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
61 template <class T, class U> constexpr bool operator!=(const T&, const optional<U>&);
62 template <class T, class U> constexpr bool operator<(const optional<T>&, const U&);
63 template <class T, class U> constexpr bool operator<(const T&, const optional<U>&);
64 template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
65 template <class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
66 template <class T, class U> constexpr bool operator>(const optional<T>&, const U&);
67 template <class T, class U> constexpr bool operator>(const T&, const optional<U>&);
68 template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
69 template <class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
72 …template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below ); // constexpr in C++…
73 template <class T> constexpr optional<see below > make_optional(T&&);
75 constexpr optional<T> make_optional(Args&&... args);
77 constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
81 template <class T> struct hash<optional<T>>;
83 template <class T> class optional {
88 constexpr optional() noexcept;
89 constexpr optional(nullopt_t) noexcept;
90 optional(const optional &);
91 optional(optional &&) noexcept(see below);
92 template <class... Args> constexpr explicit optional(in_place_t, Args &&...);
94 constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
96 constexpr EXPLICIT optional(U &&);
98 EXPLICIT optional(const optional<U> &); // constexpr in C++20
100 EXPLICIT optional(optional<U> &&); // constexpr in C++20
103 ~optional(); // constexpr in C++20
106 optional &operator=(nullopt_t) noexcept; // constexpr in C++20
107 optional &operator=(const optional &); // constexpr in C++20
108 optional &operator=(optional &&) noexcept(see below); // constexpr in C++20
109 template <class U = T> optional &operator=(U &&); // constexpr in C++20
110 template <class U> optional &operator=(const optional<U> &); // constexpr in C++20
111 template <class U> optional &operator=(optional<U> &&); // constexpr in C++20
117 void swap(optional &) noexcept(see below ); // constexpr in C++20
143 optional(T) -> optional<T>;
215 "instantiation of optional with a non-object type is undefined behavior");
257 "instantiation of optional with a non-object type is undefined behavior");
360 // optional<T&> is currently required ill-formed, however it may to be in the
590 class optional
602 "instantiation of optional with in_place_t is ill-formed");
604 "instantiation of optional with nullopt_t is ill-formed");
606 "instantiation of optional with a reference type is ill-formed");
608 "instantiation of optional with a non-destructible type is ill-formed");
610 "instantiation of optional with an array type is ill-formed");
629 _IsNotSame<__uncvref_t<_Up>, optional>::value,
635 template <class _Up, class _Opt = optional<_Up>>
646 template <class _Up, class _Opt = optional<_Up>>
693 _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
694 _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
695 _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
696 _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
706 constexpr explicit optional(_InPlaceT, _Args&&... __args)
713 constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
720 constexpr optional(_Up&& __v)
727 constexpr explicit optional(_Up&& __v)
730 // LWG2756: conditionally explicit conversion from const optional<_Up>&
735 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(const optional<_Up>& __v)
743 _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(const optional<_Up>& __v)
748 // LWG2756: conditionally explicit conversion from optional<_Up>&&
753 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional(optional<_Up>&& __v)
761 _LIBCPP_CONSTEXPR_AFTER_CXX17 explicit optional(optional<_Up>&& __v)
767 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional& operator=(nullopt_t) noexcept
773 _LIBCPP_INLINE_VISIBILITY optional& operator=(const optional&) = default;
774 _LIBCPP_INLINE_VISIBILITY optional& operator=(optional&&) = default;
780 _IsNotSame<__uncvref_t<_Up>, optional>,
790 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
805 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
806 operator=(const optional<_Up>& __v)
817 _LIBCPP_CONSTEXPR_AFTER_CXX17 optional&
818 operator=(optional<_Up>&& __v)
855 _LIBCPP_CONSTEXPR_AFTER_CXX17 void swap(optional& __opt)
885 _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
898 _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
911 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
920 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
929 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
938 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
989 "optional<T>::value_or: T must be copy constructible");
991 "optional<T>::value_or: U must be convertible to T");
1001 "optional<T>::value_or: T must be move constructible");
1003 "optional<T>::value_or: U must be convertible to T");
1030 optional(T) -> optional<T>;
1041 operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
1057 operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
1073 operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
1089 operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
1105 operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
1121 operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
1134 operator==(const optional<_Tp>& __x, nullopt_t) noexcept
1142 operator==(nullopt_t, const optional<_Tp>& __x) noexcept
1150 operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
1158 operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
1166 operator<(const optional<_Tp>&, nullopt_t) noexcept
1174 operator<(nullopt_t, const optional<_Tp>& __x) noexcept
1182 operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
1190 operator<=(nullopt_t, const optional<_Tp>&) noexcept
1198 operator>(const optional<_Tp>& __x, nullopt_t) noexcept
1206 operator>(nullopt_t, const optional<_Tp>&) noexcept
1214 operator>=(const optional<_Tp>&, nullopt_t) noexcept
1222 operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
1235 operator==(const optional<_Tp>& __x, const _Up& __v)
1247 operator==(const _Tp& __v, const optional<_Up>& __x)
1259 operator!=(const optional<_Tp>& __x, const _Up& __v)
1271 operator!=(const _Tp& __v, const optional<_Up>& __x)
1283 operator<(const optional<_Tp>& __x, const _Up& __v)
1295 operator<(const _Tp& __v, const optional<_Up>& __x)
1307 operator<=(const optional<_Tp>& __x, const _Up& __v)
1319 operator<=(const _Tp& __v, const optional<_Up>& __x)
1331 operator>(const optional<_Tp>& __x, const _Up& __v)
1343 operator>(const _Tp& __v, const optional<_Up>& __x)
1355 operator>=(const optional<_Tp>& __x, const _Up& __v)
1367 operator>=(const _Tp& __v, const optional<_Up>& __x)
1379 swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
1386 optional<decay_t<_Tp>> make_optional(_Tp&& __v)
1388 return optional<decay_t<_Tp>>(_VSTD::forward<_Tp>(__v));
1393 optional<_Tp> make_optional(_Args&&... __args)
1395 return optional<_Tp>(in_place, _VSTD::forward<_Args>(__args)...);
1400 optional<_Tp> make_optional(initializer_list<_Up> __il, _Args&&... __args)
1402 return optional<_Tp>(in_place, __il, _VSTD::forward<_Args>(__args)...);
1407 __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
1411 _LIBCPP_DEPRECATED_IN_CXX17 typedef optional<_Tp> argument_type;
1416 size_t operator()(const optional<_Tp>& __opt) const