Accidentally disallowed explicit tuple conversions when all elements of the tuple...
authorHoward Hinnant <hhinnant@apple.com>
Sun, 14 Apr 2013 00:01:13 +0000 (00:01 +0000)
committerHoward Hinnant <hhinnant@apple.com>
Sun, 14 Apr 2013 00:01:13 +0000 (00:01 +0000)
llvm-svn: 179467

libcxx/include/tuple
libcxx/test/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp

index 7f299e9..0df315e 100644 (file)
@@ -477,7 +477,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
     template <class _Tuple,
               class = typename enable_if
                       <
-                         __tuple_convertible<_Tuple, tuple<_Tp...> >::value
+                         __tuple_constructible<_Tuple, tuple<_Tp...> >::value
                       >::type
              >
         _LIBCPP_INLINE_VISIBILITY
index 60ebd93..33aed89 100644 (file)
@@ -67,4 +67,13 @@ int main()
         assert(std::get<1>(t1) == int('a'));
         assert(std::get<2>(t1).id_ == 2);
     }
+    {
+        typedef std::tuple<double, char, int> T0;
+        typedef std::tuple<int, int, B> T1;
+        T0 t0(2.5, 'a', 3);
+        T1 t1(t0);
+        assert(std::get<0>(t1) == 2);
+        assert(std::get<1>(t1) == int('a'));
+        assert(std::get<2>(t1).id_ == 3);
+    }
 }