diff options
Diffstat (limited to 'contrib/libc++/include/queue')
-rw-r--r-- | contrib/libc++/include/queue | 67 |
1 files changed, 46 insertions, 21 deletions
diff --git a/contrib/libc++/include/queue b/contrib/libc++/include/queue index 6f49c87..c657b52 100644 --- a/contrib/libc++/include/queue +++ b/contrib/libc++/include/queue @@ -66,7 +66,7 @@ public: template <class... Args> void emplace(Args&&... args); void pop(); - void swap(queue& q) noexcept(noexcept(swap(c, q.c))); + void swap(queue& q) noexcept(is_nothrow_swappable_v<Container>) }; template <class T, class Container> @@ -153,7 +153,8 @@ public: void pop(); void swap(priority_queue& q) - noexcept(noexcept(swap(c, q.c)) && noexcept(swap(comp.q.comp))); + noexcept(is_nothrow_swappable_v<Container> && + is_nothrow_swappable_v<Comp>) }; template <class T, class Container, class Compare> @@ -198,6 +199,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; + static_assert((is_same<_Tp, value_type>::value), "" ); protected: container_type c; @@ -368,7 +370,10 @@ operator<=(const queue<_Tp, _Container>& __x,const queue<_Tp, _Container>& __y) template <class _Tp, class _Container> inline _LIBCPP_INLINE_VISIBILITY -void +typename enable_if< + __is_swappable<_Container>::value, + void +>::type swap(queue<_Tp, _Container>& __x, queue<_Tp, _Container>& __y) _NOEXCEPT_(_NOEXCEPT_(__x.swap(__y))) { @@ -392,6 +397,7 @@ public: typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference; typedef typename container_type::size_type size_type; + static_assert((is_same<_Tp, value_type>::value), "" ); protected: container_type c; @@ -430,45 +436,56 @@ public: _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const value_compare& __comp) : c(), comp(__comp) {} + _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const container_type& __c); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const value_compare& __comp, container_type&& __c); #endif template <class _InputIter> + _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp = value_compare()); template <class _InputIter> + _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _InputIter> + _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY explicit priority_queue(const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, const container_type& __c, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY priority_queue(const priority_queue& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); template <class _Alloc> + _LIBCPP_INLINE_VISIBILITY priority_queue(priority_queue&& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type* = 0); @@ -481,22 +498,26 @@ public: _LIBCPP_INLINE_VISIBILITY const_reference top() const {return c.front();} + _LIBCPP_INLINE_VISIBILITY void push(const value_type& __v); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY void push(value_type&& __v); #ifndef _LIBCPP_HAS_NO_VARIADICS - template <class... _Args> void emplace(_Args&&... __args); + template <class... _Args> _LIBCPP_INLINE_VISIBILITY void emplace(_Args&&... __args); #endif #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES + _LIBCPP_INLINE_VISIBILITY void pop(); + _LIBCPP_INLINE_VISIBILITY void swap(priority_queue& __q) _NOEXCEPT_(__is_nothrow_swappable<container_type>::value && __is_nothrow_swappable<value_compare>::value); }; template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp, const container_type& __c) : c(__c), @@ -508,7 +529,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Compare& __comp #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, container_type&& __c) : c(_VSTD::move(__c)), @@ -521,7 +542,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ template <class _Tp, class _Container, class _Compare> template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp) : c(__f, __l), @@ -532,7 +553,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input template <class _Tp, class _Container, class _Compare> template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c) @@ -547,7 +568,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input template <class _Tp, class _Container, class _Compare> template <class _InputIter> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c) @@ -562,7 +583,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _Input template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a, typename enable_if<uses_allocator<container_type, _Alloc>::value>::type*) @@ -572,7 +593,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const _Alloc& __a, template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, const _Alloc& __a, typename enable_if<uses_allocator<container_type, @@ -584,7 +605,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, const container_type& __c, const _Alloc& __a, @@ -598,7 +619,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, @@ -613,7 +634,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const priority_queue& template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& __comp, container_type&& __c, const _Alloc& __a, @@ -627,7 +648,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(const value_compare& _ template <class _Tp, class _Container, class _Compare> template <class _Alloc> -inline _LIBCPP_INLINE_VISIBILITY +inline priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q, const _Alloc& __a, typename enable_if<uses_allocator<container_type, @@ -641,7 +662,7 @@ priority_queue<_Tp, _Container, _Compare>::priority_queue(priority_queue&& __q, #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline void priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v) { @@ -652,7 +673,7 @@ priority_queue<_Tp, _Container, _Compare>::push(const value_type& __v) #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline void priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v) { @@ -664,7 +685,7 @@ priority_queue<_Tp, _Container, _Compare>::push(value_type&& __v) template <class _Tp, class _Container, class _Compare> template <class... _Args> -inline _LIBCPP_INLINE_VISIBILITY +inline void priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args) { @@ -676,7 +697,7 @@ priority_queue<_Tp, _Container, _Compare>::emplace(_Args&&... __args) #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline void priority_queue<_Tp, _Container, _Compare>::pop() { @@ -685,7 +706,7 @@ priority_queue<_Tp, _Container, _Compare>::pop() } template <class _Tp, class _Container, class _Compare> -inline _LIBCPP_INLINE_VISIBILITY +inline void priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q) _NOEXCEPT_(__is_nothrow_swappable<container_type>::value && @@ -698,7 +719,11 @@ priority_queue<_Tp, _Container, _Compare>::swap(priority_queue& __q) template <class _Tp, class _Container, class _Compare> inline _LIBCPP_INLINE_VISIBILITY -void +typename enable_if< + __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))) |