[cfe-commits] [libcxx] r132421 - in /libcxx/trunk/include: array tuple utility
Howard Hinnant
hhinnant at apple.com
Wed Jun 1 12:59:32 PDT 2011
Author: hhinnant
Date: Wed Jun 1 14:59:32 2011
New Revision: 132421
URL: http://llvm.org/viewvc/llvm-project?rev=132421&view=rev
Log:
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.
Modified:
libcxx/trunk/include/array
libcxx/trunk/include/tuple
libcxx/trunk/include/utility
Modified: libcxx/trunk/include/array
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/array?rev=132421&r1=132420&r2=132421&view=diff
==============================================================================
--- libcxx/trunk/include/array (original)
+++ libcxx/trunk/include/array Wed Jun 1 14:59:32 2011
@@ -270,7 +270,11 @@
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)
{
Modified: libcxx/trunk/include/tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/tuple?rev=132421&r1=132420&r2=132421&view=diff
==============================================================================
--- libcxx/trunk/include/tuple (original)
+++ libcxx/trunk/include/tuple Wed Jun 1 14:59:32 2011
@@ -587,7 +587,11 @@
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);}
Modified: libcxx/trunk/include/utility
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/utility?rev=132421&r1=132420&r2=132421&view=diff
==============================================================================
--- libcxx/trunk/include/utility (original)
+++ libcxx/trunk/include/utility Wed Jun 1 14:59:32 2011
@@ -377,7 +377,12 @@
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))
More information about the cfe-commits
mailing list