From 27cdf401eaa84e0d4ae82d174ddba6453e882856 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sat, 2 Jul 2016 01:25:46 +0000 Subject: [PATCH] Cleanup SFINAE in tuple, and add tests for reference assignment llvm-svn: 274414 --- libcxx/include/__tuple | 45 +++++++------------ .../tuple.assign/convert_copy.pass.cpp | 12 +++++ .../tuple.assign/convert_move.pass.cpp | 19 ++++++++ 3 files changed, 47 insertions(+), 29 deletions(-) diff --git a/libcxx/include/__tuple b/libcxx/include/__tuple index 0d180c701593..cc9fbbebc096 100644 --- a/libcxx/include/__tuple +++ b/libcxx/include/__tuple @@ -335,11 +335,11 @@ struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { template struct __make_tuple_types_flat, __tuple_indices<_Idx...>> { - using _Array = array<_Vt, _Np>; - + template + using __value_type = _Vt; template > using __apply_quals = __tuple_types< - typename _ApplyFn::template __apply::type>... + typename _ApplyFn::template __apply<__value_type<_Idx>>... >; }; @@ -371,32 +371,19 @@ template using __all = is_same<__all_dummy<_Pred...>, __all_dummy<(_Pred, true)...>>; struct __tuple_sfinae_base { - template - static auto __test_constructible(__tuple_types<_FromArgs...>, __tuple_types<_ToArgs...>) - -> __all::value - , bool>::type{true}...>; - static auto __test_constructible(...) -> false_type; - template - using __constructible = decltype(__test_constructible(_Types1{}, _Types2{})); + template