Lines Matching refs:optional

2 //===-------------------------- optional ----------------------------------===//
15 optional synopsis
23 // optional for object types
25 class optional
31 constexpr optional() noexcept;
32 constexpr optional(nullopt_t) noexcept;
33 optional(const optional&);
34 optional(optional&&) noexcept(is_nothrow_move_constructible<T>::value);
35 constexpr optional(const T&);
36 constexpr optional(T&&);
37 template <class... Args> constexpr explicit optional(in_place_t, Args&&...);
39 constexpr explicit optional(in_place_t, initializer_list<U>, Args&&...);
42 ~optional();
45 optional& operator=(nullopt_t) noexcept;
46 optional& operator=(const optional&);
47 optional& operator=(optional&&)
50 template <class U> optional& operator=(U&&);
55 void swap(optional&)
89 template <class T> constexpr bool operator==(const optional<T>&, const optional<T>&);
90 template <class T> constexpr bool operator< (const optional<T>&, const optional<T>&);
93 template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
94 template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
95 template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept;
96 template <class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept;
99 template <class T> constexpr bool operator==(const optional<T>&, const T&);
100 template <class T> constexpr bool operator==(const T&, const optional<T>&);
101 template <class T> constexpr bool operator<(const optional<T>&, const T&);
102 template <class T> constexpr bool operator<(const T&, const optional<T>&);
105 template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below);
106 template <class T> constexpr optional<typename decay<T>::type> make_optional(T&&);
110 template <class T> struct hash<optional<T>>;
286 class optional
294 "Instantiation of optional with a reference type is ill-formed.");
296 "Instantiation of optional with a in_place_t type is ill-formed.");
298 "Instantiation of optional with a nullopt_t type is ill-formed.");
300 "Instantiation of optional with a non-object type is undefined behavior.");
302 …"Instantiation of optional with an object type that is not noexcept destructible is undefined beha…
304 _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
305 _LIBCPP_INLINE_VISIBILITY optional(const optional&) = default;
306 _LIBCPP_INLINE_VISIBILITY optional(optional&&) = default;
307 _LIBCPP_INLINE_VISIBILITY ~optional() = default;
308 _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
309 _LIBCPP_INLINE_VISIBILITY constexpr optional(const value_type& __v)
311 _LIBCPP_INLINE_VISIBILITY constexpr optional(value_type&& __v)
322 explicit optional(in_place_t, _Args&&... __args)
333 explicit optional(in_place_t, initializer_list<_Up> __il, _Args&&... __args)
337 optional& operator=(nullopt_t) noexcept
348 optional&
349 operator=(const optional& __opt)
368 optional&
369 operator=(optional&& __opt)
398 optional&
443 swap(optional& __opt)
474 _LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value");
482 _LIBCPP_ASSERT(this->__engaged_, "optional operator-> called for disengaged value");
491 _LIBCPP_ASSERT(this->__engaged_, "optional operator* called for disengaged value");
499 _LIBCPP_ASSERT(this->__engaged_, "optional operator* called for disengaged value");
510 throw bad_optional_access("optional<T>::value: not engaged");
518 throw bad_optional_access("optional<T>::value: not engaged");
527 "optional<T>::value_or: T must be copy constructible");
529 "optional<T>::value_or: U must be convertible to T");
539 "optional<T>::value_or: T must be move constructible");
541 "optional<T>::value_or: U must be convertible to T");
567 operator==(const optional<_Tp>& __x, const optional<_Tp>& __y)
580 operator<(const optional<_Tp>& __x, const optional<_Tp>& __y)
593 operator==(const optional<_Tp>& __x, nullopt_t) noexcept
602 operator==(nullopt_t, const optional<_Tp>& __x) noexcept
611 operator<(const optional<_Tp>&, nullopt_t) noexcept
620 operator<(nullopt_t, const optional<_Tp>& __x) noexcept
629 operator==(const optional<_Tp>& __x, const _Tp& __v)
638 operator==(const _Tp& __v, const optional<_Tp>& __x)
647 operator<(const optional<_Tp>& __x, const _Tp& __v)
656 operator<(const _Tp& __v, const optional<_Tp>& __x)
664 swap(optional<_Tp>& __x, optional<_Tp>& __y) noexcept(noexcept(__x.swap(__y)))
672 optional<typename decay<_Tp>::type>
675 return optional<typename decay<_Tp>::type>(_VSTD::forward<_Tp>(__v));
683 struct _LIBCPP_TYPE_VIS_ONLY hash<std::experimental::optional<_Tp> >
685 typedef std::experimental::optional<_Tp> argument_type;