From 92b69215e63a3303a5e904ab332e2eec236e0ed2 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 16 Aug 2021 23:30:18 -0700 Subject: update libcxx, libcxxabi, libunwind, and tsan to llvm 13 rc1 --- lib/libcxx/include/queue | 124 ++++++++++++++++++++--------------------------- 1 file changed, 53 insertions(+), 71 deletions(-) (limited to 'lib/libcxx/include/queue') diff --git a/lib/libcxx/include/queue b/lib/libcxx/include/queue index a2048c1e22..42470e3a10 100644 --- a/lib/libcxx/include/queue +++ b/lib/libcxx/include/queue @@ -179,10 +179,13 @@ template */ #include <__config> +#include <__memory/uses_allocator.h> +#include <__utility/forward.h> +#include +#include #include -#include #include -#include +#include #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -238,47 +241,42 @@ public: queue& operator=(queue&& __q) _NOEXCEPT_(is_nothrow_move_assignable::value) {c = _VSTD::move(__q.c); return *this;} -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit queue(const container_type& __c) : c(__c) {} #ifndef _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {} -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY explicit queue(const _Alloc& __a, - typename enable_if::value>::type* = 0) + _EnableIf::value>* = 0) : c(__a) {} template _LIBCPP_INLINE_VISIBILITY queue(const queue& __q, const _Alloc& __a, - typename enable_if::value>::type* = 0) + _EnableIf::value>* = 0) : c(__q.c, __a) {} template _LIBCPP_INLINE_VISIBILITY queue(const container_type& __c, const _Alloc& __a, - typename enable_if::value>::type* = 0) + _EnableIf::value>* = 0) : c(__c, __a) {} #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY queue(container_type&& __c, const _Alloc& __a, - typename enable_if::value>::type* = 0) + _EnableIf::value>* = 0) : c(_VSTD::move(__c), __a) {} template _LIBCPP_INLINE_VISIBILITY queue(queue&& __q, const _Alloc& __a, - typename enable_if::value>::type* = 0) + _EnableIf::value>* = 0) : c(_VSTD::move(__q.c), __a) {} -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} @@ -308,7 +306,7 @@ public: void emplace(_Args&&... __args) { c.emplace_back(_VSTD::forward<_Args>(__args)...);} #endif -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void pop() {c.pop_front();} @@ -335,15 +333,15 @@ public: #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES template::value, nullptr_t>::type + class = _EnableIf::value> > queue(_Container) -> queue; template::value, nullptr_t>::type, - class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type + class = _EnableIf::value>, + class = _EnableIf::value> > queue(_Container, _Alloc) -> queue; @@ -399,10 +397,7 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y) template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if< - __is_swappable<_Container>::value, - void ->::type +_EnableIf<__is_swappable<_Container>::value, void> swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { @@ -458,7 +453,7 @@ public: _NOEXCEPT_(is_nothrow_move_assignable::value && is_nothrow_move_assignable::value) {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;} -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const value_compare& __comp) @@ -482,41 +477,35 @@ public: _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c); -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const _Alloc& __a, - typename enable_if::value>::type* = 0); + _EnableIf::value>* = 0); template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const _Alloc& __a, - typename enable_if::value>::type* = 0); + _EnableIf::value>* = 0); template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const container_type& __c, const _Alloc& __a, - typename enable_if::value>::type* = 0); + _EnableIf::value>* = 0); template _LIBCPP_INLINE_VISIBILITY priority_queue(const priority_queue& __q, const _Alloc& __a, - typename enable_if::value>::type* = 0); + _EnableIf::value>* = 0); #ifndef _LIBCPP_CXX03_LANG template _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a, - typename enable_if::value>::type* = 0); + _EnableIf::value>* = 0); template _LIBCPP_INLINE_VISIBILITY priority_queue(priority_queue&& __q, const _Alloc& __a, - typename enable_if::value>::type* = 0); -#endif // _LIBCPP_CXX03_LANG + _EnableIf::value>* = 0); +#endif // _LIBCPP_CXX03_LANG _LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY bool empty() const {return c.empty();} @@ -533,7 +522,7 @@ public: template _LIBCPP_INLINE_VISIBILITY void emplace(_Args&&... __args); -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG _LIBCPP_INLINE_VISIBILITY void pop(); @@ -546,28 +535,28 @@ public: #ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES template ::value, nullptr_t>::type, - class = typename enable_if::value, nullptr_t>::type + class = _EnableIf::value>, + class = _EnableIf::value> > priority_queue(_Compare, _Container) -> priority_queue; template::value_type>, - class _Container = vector::value_type>, - class = typename enable_if< __is_cpp17_input_iterator<_InputIterator>::value, nullptr_t>::type, - class = typename enable_if::value, nullptr_t>::type, - class = typename enable_if::value, nullptr_t>::type + class _Compare = less<__iter_value_type<_InputIterator>>, + class _Container = vector<__iter_value_type<_InputIterator>>, + class = _EnableIf<__is_cpp17_input_iterator<_InputIterator>::value>, + class = _EnableIf::value>, + class = _EnableIf::value> > priority_queue(_InputIterator, _InputIterator, _Compare = _Compare(), _Container = _Container()) - -> priority_queue::value_type, _Container, _Compare>; + -> priority_queue<__iter_value_type<_InputIterator>, _Container, _Compare>; template::value, nullptr_t>::type, - class = typename enable_if::value, nullptr_t>::type, - class = typename enable_if< __is_allocator<_Alloc>::value, nullptr_t>::type + class = _EnableIf::value>, + class = _EnableIf::value>, + class = _EnableIf::value> > priority_queue(_Compare, _Container, _Alloc) -> priority_queue; @@ -595,7 +584,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template template @@ -636,14 +625,13 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(__a) { } @@ -653,8 +641,7 @@ template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(__a), comp(__comp) { @@ -666,8 +653,7 @@ inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, const container_type& __c, const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(__c, __a), comp(__comp) { @@ -679,8 +665,7 @@ template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q, const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(__q.c, __a), comp(__q.comp) { @@ -695,8 +680,7 @@ inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(_VSTD::move(__c), __a), comp(__comp) { @@ -708,15 +692,14 @@ template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q, const _Alloc& __a, - typename enable_if::value>::type*) + _EnableIf::value>*) : c(_VSTD::move(__q.c), __a), comp(_VSTD::move(__q.comp)) { _VSTD::make_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template inline @@ -748,7 +731,7 @@ priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args) _VSTD::push_heap(c.begin(), c.end(), comp); } -#endif // _LIBCPP_CXX03_LANG +#endif // _LIBCPP_CXX03_LANG template inline @@ -773,11 +756,10 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q) template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if< - __is_swappable<_Container>::value - && __is_swappable<_Compare>::value, +_EnableIf< + __is_swappable<_Container>::value && __is_swappable<_Compare>::value, void ->::type +> swap(priority_queue<_Tp, _Container, _Compare>& __x, priority_queue<_Tp, _Container, _Compare>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) @@ -793,4 +775,4 @@ struct _LIBCPP_TEMPLATE_VIS uses_allocator