Experimental support for a meaningful __is_swappable<T>::value. This does not appear to be strictly needed for correct functioning of the library. If it causes any problems, I'd rather pull it sooner rather than later.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@132421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -270,7 +270,11 @@ operator>=(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
|||||||
|
|
||||||
template <class _Tp, size_t _Size>
|
template <class _Tp, size_t _Size>
|
||||||
_LIBCPP_INLINE_VISIBILITY inline
|
_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)
|
swap(const array<_Tp, _Size>& __x, const array<_Tp, _Size>& __y)
|
||||||
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
_NOEXCEPT_(__is_nothrow_swappable<_Tp>::value)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -587,7 +587,11 @@ public:
|
|||||||
|
|
||||||
template <class ..._Tp>
|
template <class ..._Tp>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
void
|
typename enable_if
|
||||||
|
<
|
||||||
|
__all<__is_swappable<_Tp>::value...>::value,
|
||||||
|
void
|
||||||
|
>::type
|
||||||
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
|
swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
|
||||||
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
_NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
|
||||||
{__t.swap(__u);}
|
{__t.swap(__u);}
|
||||||
|
|||||||
@@ -377,7 +377,12 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
|
|||||||
|
|
||||||
template <class _T1, class _T2>
|
template <class _T1, class _T2>
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
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)
|
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
|
||||||
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
|
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
|
||||||
__is_nothrow_swappable<_T2>::value))
|
__is_nothrow_swappable<_T2>::value))
|
||||||
|
|||||||
Reference in New Issue
Block a user