[cfe-commits] [libcxx] r134252 - in /libcxx/trunk/include: __tuple utility

Howard Hinnant hhinnant at apple.com
Fri Jul 1 13:12:51 PDT 2011


Author: hhinnant
Date: Fri Jul  1 15:12:51 2011
New Revision: 134252

URL: http://llvm.org/viewvc/llvm-project?rev=134252&view=rev
Log:
Changed constraints on pair and tuple constructors from is_convertible to is_constructible.

Modified:
    libcxx/trunk/include/__tuple
    libcxx/trunk/include/utility

Modified: libcxx/trunk/include/__tuple
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__tuple?rev=134252&r1=134251&r2=134252&view=diff
==============================================================================
--- libcxx/trunk/include/__tuple (original)
+++ libcxx/trunk/include/__tuple Fri Jul  1 15:12:51 2011
@@ -214,11 +214,7 @@
 template <class _Tp0, class ..._Tp, class _Up0, class ..._Up>
 struct __tuple_convertible_imp<true, __tuple_types<_Tp0, _Tp...>, __tuple_types<_Up0, _Up...> >
     : public integral_constant<bool,
-#if 1 // waiting on cwg 1170
-                               is_convertible<_Tp0, _Up0>::value &&
-#else
                                is_constructible<_Up0, _Tp0>::value &&
-#endif
                                __tuple_convertible_imp<true, __tuple_types<_Tp...>, __tuple_types<_Up...> >::value> {};
 
 template <>

Modified: libcxx/trunk/include/utility
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/utility?rev=134252&r1=134251&r2=134252&view=diff
==============================================================================
--- libcxx/trunk/include/utility (original)
+++ libcxx/trunk/include/utility Fri Jul  1 15:12:51 2011
@@ -227,8 +227,8 @@
     template<class _U1, class _U2>
         _LIBCPP_INLINE_VISIBILITY
         pair(const pair<_U1, _U2>& __p,
-                 typename enable_if<is_convertible<_U1, _T1>::value &&
-                                    is_convertible<_U2, _T2>::value>::type* = 0)
+                 typename enable_if<is_constructible<_T1, _U1>::value &&
+                                    is_constructible<_T2, _U2>::value>::type* = 0)
             : first(__p.first), second(__p.second) {}
 
     _LIBCPP_INLINE_VISIBILITY
@@ -253,8 +253,8 @@
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     template <class _U1, class _U2,
-              class = typename enable_if<is_convertible<_U1, first_type >::value &&
-                                         is_convertible<_U2, second_type>::value>::type>
+              class = typename enable_if<is_constructible<first_type, _U1 >::value &&
+                                         is_constructible<second_type, _U2>::value>::type>
         _LIBCPP_INLINE_VISIBILITY
         pair(_U1&& __u1, _U2&& __u2)
             : first(_VSTD::forward<_U1>(__u1)),
@@ -264,8 +264,8 @@
     template<class _U1, class _U2>
         _LIBCPP_INLINE_VISIBILITY
         pair(pair<_U1, _U2>&& __p,
-                 typename enable_if<is_convertible<_U1, _T1>::value &&
-                                    is_convertible<_U2, _T2>::value>::type* = 0)
+                 typename enable_if<is_constructible<_T1, _U1>::value &&
+                                    is_constructible<_T2, _U2>::value>::type* = 0)
             : first(_VSTD::forward<_U1>(__p.first)),
               second(_VSTD::forward<_U2>(__p.second)) {}
 





More information about the cfe-commits mailing list