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 );
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 constexpr EXPLICIT optional(const optional<U> &);
100 constexpr EXPLICIT optional(optional<U> &&);
103 ~optional();
106 optional &operator=(nullopt_t) noexcept;
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 &&);
110 template <class U> optional &operator=(const optional<U> &);
111 template <class U> optional &operator=(optional<U> &&);
117 void swap(optional &) noexcept(see below );
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");
356 // optional<T&> is currently required ill-formed, however it may to be in the
586 class optional
598 "instantiation of optional with in_place_t is ill-formed");
600 "instantiation of optional with nullopt_t is ill-formed");
602 "instantiation of optional with a reference type is ill-formed");
604 "instantiation of optional with a non-destructible type is ill-formed");
606 "instantiation of optional with an array type is ill-formed");
625 _IsNotSame<__uncvref_t<_Up>, optional>::value,
631 template <class _Up, class _Opt = optional<_Up>>
642 template <class _Up, class _Opt = optional<_Up>>
689 _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
690 _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
691 _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
692 _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
702 constexpr explicit optional(_InPlaceT, _Args&&... __args)
709 constexpr explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
716 constexpr optional(_Up&& __v)
723 constexpr explicit optional(_Up&& __v)
726 // LWG2756: conditionally explicit conversion from const optional<_Up>&
731 optional(const optional<_Up>& __v)
739 explicit optional(const optional<_Up>& __v)
744 // LWG2756: conditionally explicit conversion from optional<_Up>&&
749 optional(optional<_Up>&& __v)
757 explicit optional(optional<_Up>&& __v)
763 optional& operator=(nullopt_t) noexcept
769 _LIBCPP_INLINE_VISIBILITY optional& operator=(const optional&) = default;
770 _LIBCPP_INLINE_VISIBILITY optional& operator=(optional&&) = default;
776 _IsNotSame<__uncvref_t<_Up>, optional>,
786 optional&
801 optional&
802 operator=(const optional<_Up>& __v)
813 optional&
814 operator=(optional<_Up>&& __v)
851 void swap(optional& __opt)
881 _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
894 _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
907 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
916 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
925 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
934 _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
985 "optional<T>::value_or: T must be copy constructible");
987 "optional<T>::value_or: U must be convertible to T");
997 "optional<T>::value_or: T must be move constructible");
999 "optional<T>::value_or: U must be convertible to T");
1026 optional(T) -> optional<T>;
1037 operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
1053 operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
1069 operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
1085 operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
1101 operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
1117 operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
1130 operator==(const optional<_Tp>& __x, nullopt_t) noexcept
1138 operator==(nullopt_t, const optional<_Tp>& __x) noexcept
1146 operator!=(const optional<_Tp>& __x, nullopt_t) noexcept
1154 operator!=(nullopt_t, const optional<_Tp>& __x) noexcept
1162 operator<(const optional<_Tp>&, nullopt_t) noexcept
1170 operator<(nullopt_t, const optional<_Tp>& __x) noexcept
1178 operator<=(const optional<_Tp>& __x, nullopt_t) noexcept
1186 operator<=(nullopt_t, const optional<_Tp>&) noexcept
1194 operator>(const optional<_Tp>& __x, nullopt_t) noexcept
1202 operator>(nullopt_t, const optional<_Tp>&) noexcept
1210 operator>=(const optional<_Tp>&, nullopt_t) noexcept
1218 operator>=(nullopt_t, const optional<_Tp>& __x) noexcept
1231 operator==(const optional<_Tp>& __x, const _Up& __v)
1243 operator==(const _Tp& __v, const optional<_Up>& __x)
1255 operator!=(const optional<_Tp>& __x, const _Up& __v)
1267 operator!=(const _Tp& __v, const optional<_Up>& __x)
1279 operator<(const optional<_Tp>& __x, const _Up& __v)
1291 operator<(const _Tp& __v, const optional<_Up>& __x)
1303 operator<=(const optional<_Tp>& __x, const _Up& __v)
1315 operator<=(const _Tp& __v, const optional<_Up>& __x)
1327 operator>(const optional<_Tp>& __x, const _Up& __v)
1339 operator>(const _Tp& __v, const optional<_Up>& __x)
1351 operator>=(const optional<_Tp>& __x, const _Up& __v)
1363 operator>=(const _Tp& __v, const optional<_Up>& __x)
1375 swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
1382 optional<decay_t<_Tp>> make_optional(_Tp&& __v)
1384 return optional<decay_t<_Tp>>(_VSTD::forward<_Tp>(__v));
1389 optional<_Tp> make_optional(_Args&&... __args)
1391 return optional<_Tp>(in_place, _VSTD::forward<_Args>(__args)...);
1396 optional<_Tp> make_optional(initializer_list<_Up> __il, _Args&&... __args)
1398 return optional<_Tp>(in_place, __il, _VSTD::forward<_Args>(__args)...);
1403 __enable_hash_helper<optional<_Tp>, remove_const_t<_Tp>>
1406 typedef optional<_Tp> argument_type;