summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/array6
-rw-r--r--libcxx/include/tuple6
-rw-r--r--libcxx/include/utility7
3 files changed, 16 insertions, 3 deletions
diff --git a/libcxx/include/array b/libcxx/include/array
index 188d24d7f1a..888fac21e53 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -270,7 +270,11 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
template <class _Tp, size_t _Size>
_LIBCPP_INLINE_VISIBILITY inline
-void
+typename enable_if
+<
+ __is_swappable<_Tp>::value,
+ void
+>::type
swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
{
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 49f220d0c02..c075e42e9cb 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -587,7 +587,11 @@ public:
template <class ..._Tp>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if
+<
+ __all<__is_swappable<_Tp>::value...>::value,
+ void
+>::type
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
{__t.swap(__u);}
diff --git a/libcxx/include/utility b/libcxx/include/utility
index d0ad1ec86e0..6934c1e08d9 100644
--- a/libcxx/include/utility
+++ b/libcxx/include/utility
@@ -377,7 +377,12 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY
-void
+typename enable_if
+<
+ __is_swappable<_T1>::value &&
+ __is_swappable<_T2>::value,
+ void
+>::type
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
__is_nothrow_swappable<_T2>::value))
OpenPOWER on IntegriCloud