summaryrefslogtreecommitdiffstats
path: root/libcxx/include/queue
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include/queue')
-rw-r--r--libcxx/include/queue16
1 files changed, 12 insertions, 4 deletions
diff --git a/libcxx/include/queue b/libcxx/include/queue
index 81b83a7701e..2509b93ede6 100644
--- a/libcxx/include/queue
+++ b/libcxx/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>
@@ -369,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)))
{
@@ -700,7 +704,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)))
OpenPOWER on IntegriCloud