From 44e6418f2227a3aeb55a6dc917d8dbe30e08ce20 Mon Sep 17 00:00:00 2001 From: Michael Schellenberger Costa Date: Mon, 9 Oct 2023 15:03:35 +0200 Subject: [PATCH] Modernize tuple --- .../tuple.assign/convert_copy.pass.cpp | 2 - .../tuple.assign/convert_move.pass.cpp | 2 - .../tuple.tuple/tuple.assign/copy.pass.cpp | 2 - .../tuple.tuple/tuple.assign/move.pass.cpp | 2 - ...PR22806_constrain_tuple_like_ctor.pass.cpp | 8 - .../tuple.cnstr/alloc_move.pass.cpp | 6 - .../tuple.cnstr/convert_copy.pass.cpp | 2 - .../tuple.tuple/tuple.cnstr/move.pass.cpp | 4 - .../tuple.cnstr/nothrow_cnstr.pass.cpp | 4 - .../tuple.creation/forward_as_tuple.pass.cpp | 2 - .../tuple.creation/tuple_cat.pass.cpp | 8 - .../tuple.elem/get_const_rv.pass.cpp | 2 - .../tuple.tuple/tuple.elem/get_rv.pass.cpp | 2 - .../tuple.elem/tuple.by.type.pass.cpp | 2 - .../tuple.special/non_member_swap.pass.cpp | 2 - .../tuple.swap/member_swap.pass.cpp | 2 - .../detail/libcxx/include/__functional/bind.h | 13 +- .../std/detail/libcxx/include/__fwd/get.h | 68 +- .../libcxx/include/__tuple_dir/apply_cv.h | 60 +- .../include/__tuple_dir/make_tuple_types.h | 49 +- .../include/__tuple_dir/sfinae_helpers.h | 187 +- .../include/__tuple_dir/structured_bindings.h | 279 ++- .../include/__tuple_dir/tuple_element.h | 83 +- .../include/__tuple_dir/tuple_indices.h | 11 +- .../libcxx/include/__tuple_dir/tuple_like.h | 46 +- .../libcxx/include/__tuple_dir/tuple_size.h | 54 +- .../libcxx/include/__tuple_dir/tuple_types.h | 8 +- .../detail/libcxx/include/__utility/pair.h | 20 +- .../cuda/std/detail/libcxx/include/tuple | 1946 ++++++++--------- libcudacxx/libcxx/docs/UsingLibcxx.rst | 27 - ...ed_arity_initialization_extension.pass.cpp | 119 - 31 files changed, 1327 insertions(+), 1695 deletions(-) delete mode 100644 libcudacxx/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/enable_reduced_arity_initialization_extension.pass.cpp diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp index 2a2c00858b..403f744a71 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_copy.pass.cpp @@ -75,7 +75,6 @@ int main(int, char**) assert(cuda::std::get<1>(t1) == int('a')); assert(cuda::std::get<2>(t1).id_ == 2); } -#if !defined(TEST_COMPILER_MSVC_2017) { // Test that tuple evaluates correctly applies an lvalue reference // before evaluating is_assignable (ie 'is_assignable') @@ -88,6 +87,5 @@ int main(int, char**) assert(cuda::std::get<0>(t) == 43); assert(&cuda::std::get<0>(t) == &x); } -#endif return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp index 77f97ad884..741e79e953 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/convert_move.pass.cpp @@ -99,7 +99,6 @@ int main(int, char**) assert(cuda::std::get<1>(t1) == int('a')); assert(cuda::std::get<2>(t1)->id_ == 3); }*/ -#if !defined(TEST_COMPILER_MSVC_2017) { // Test that tuple evaluates correctly applies an lvalue reference // before evaluating is_assignable (ie 'is_assignable') @@ -112,6 +111,5 @@ int main(int, char**) assert(cuda::std::get<0>(t) == 43); assert(&cuda::std::get<0>(t) == &x); } -#endif return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp index 65ea14ca88..d9b5464999 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/copy.pass.cpp @@ -72,7 +72,6 @@ int main(int, char**) assert(cuda::std::get<2>(t) == "some text"); } */ -#if !defined(TEST_COMPILER_MSVC_2017) { // test reference assignment. using T = cuda::std::tuple; @@ -88,7 +87,6 @@ int main(int, char**) assert(cuda::std::get<1>(t) == y2); assert(&cuda::std::get<1>(t) == &y); } -#endif // cuda::std::unique_ptr not supported /* { diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp index 0d0af9fc12..5f138ba09a 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp @@ -57,7 +57,6 @@ int main(int, char**) t = cuda::std::move(t0); unused(t); } -#if !defined(TEST_COMPILER_MSVC_2017) { typedef cuda::std::tuple T; T t0(MoveOnly(0)); @@ -97,7 +96,6 @@ int main(int, char**) assert(cuda::std::get<1>(t) == y2); assert(&cuda::std::get<1>(t) == &y); } -#endif // cuda::std::unique_ptr not supported /* { diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp index 7c4eac6003..3c1ebf84cd 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR22806_constrain_tuple_like_ctor.pass.cpp @@ -97,11 +97,9 @@ int main(int, char**) // cuda::std::allocator not supported // cuda::std::allocator A; { // rvalue reference -#if !defined(TEST_COMPILER_MSVC_2017) T t1(42); cuda::std::tuple< T&& > t2(cuda::std::move(t1)); assert(&cuda::std::get<0>(t2) == &t1); -#endif } { // const lvalue reference T t1(42); @@ -119,12 +117,10 @@ int main(int, char**) assert(&cuda::std::get<0>(t2) == &t1); } { // const rvalue reference -#if !defined(TEST_COMPILER_MSVC_2017) T t1(42); cuda::std::tuple< T const && > t2(cuda::std::move(t1)); assert(&cuda::std::get<0>(t2) == &t1); -#endif } // cuda::std::allocator not supported /* @@ -159,20 +155,16 @@ int main(int, char**) // the 'tuple(UTypes...)' ctor should be chosen and 'UDT' constructed from // 'tuple'. { -#if !defined(TEST_COMPILER_MSVC_2017) using VT = ConstructibleFromTupleAndInt; cuda::std::tuple t1(42); cuda::std::tuple t2(t1); assert(cuda::std::get<0>(t2).state == VT::FromTuple); -#endif } { -#if !defined(TEST_COMPILER_MSVC_2017) using VT = ConvertibleFromTupleAndInt; cuda::std::tuple t1(42); cuda::std::tuple t2 = {t1}; assert(cuda::std::get<0>(t2).state == VT::FromTuple); -#endif } // Test constructing a 1-tuple of the form tuple from another 1-tuple // 'tuple' where UDT cannot be constructed from 'tuple' but can diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp index 771a5cc355..87ca0bb701 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_move.pass.cpp @@ -33,12 +33,10 @@ int main(int, char**) T t(cuda::std::allocator_arg, A1(), cuda::std::move(t0)); } { -#if !defined(TEST_COMPILER_MSVC_2017) typedef cuda::std::tuple T; T t0(MoveOnly(0)); T t(cuda::std::allocator_arg, A1(), cuda::std::move(t0)); assert(cuda::std::get<0>(t) == 0); -#endif } { typedef cuda::std::tuple T; @@ -59,7 +57,6 @@ int main(int, char**) // testing extensions #ifdef _LIBCUDACXX_VERSION { -#if !defined(TEST_COMPILER_MSVC_2017) typedef cuda::std::tuple T; T t0(0 ,1); alloc_first::allocator_constructed() = false; @@ -67,10 +64,8 @@ int main(int, char**) assert(alloc_first::allocator_constructed()); assert(cuda::std::get<0>(t) == 0); assert(cuda::std::get<1>(t) == 1); -#endif } { -#if !defined(TEST_COMPILER_MSVC_2017) typedef cuda::std::tuple T; T t0(1, 2, 3); alloc_first::allocator_constructed() = false; @@ -81,7 +76,6 @@ int main(int, char**) assert(cuda::std::get<0>(t) == 1); assert(cuda::std::get<1>(t) == 2); assert(cuda::std::get<2>(t) == 3); -#endif } #endif diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp index 9cc3cf3406..0ca9d28c66 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/convert_copy.pass.cpp @@ -150,11 +150,9 @@ int main(int, char**) static_assert(cuda::std::is_convertible::value, ""); static_assert(cuda::std::is_convertible&&, const cuda::std::tuple&>::value, ""); -#if !defined(TEST_COMPILER_MSVC_2017) ExplicitTwo e; cuda::std::tuple t = cuda::std::tuple(cuda::std::move(e)); ((void)t); -#endif } return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp index baf5a7d6c2..97419419e8 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/move.pass.cpp @@ -64,9 +64,7 @@ __host__ __device__ void test_sfinae() { } // args constructors { -#if !defined(TEST_COMPILER_MSVC_2017) static_assert(cuda::std::is_constructible::value, ""); -#endif static_assert(!cuda::std::is_constructible::value, ""); static_assert(!cuda::std::is_constructible::value, ""); } @@ -96,7 +94,6 @@ int main(int, char**) T t = cuda::std::move(t0); unused(t); // Prevent unused warning } -#if !defined(TEST_COMPILER_MSVC_2017) { typedef cuda::std::tuple T; T t0(MoveOnly(0)); @@ -127,7 +124,6 @@ int main(int, char**) d_t d2(static_cast(d)); unused(d2); } -#endif { test_sfinae(); test_sfinae(); diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/nothrow_cnstr.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/nothrow_cnstr.pass.cpp index 5e3ca56c02..5a140d8b19 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/nothrow_cnstr.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/nothrow_cnstr.pass.cpp @@ -14,10 +14,6 @@ // UNSUPPORTED: c++98, c++03 - -// XFAIL: gcc-8 && c++17 && !nvrtc -// XFAIL: gcc-7 && c++17 && !nvrtc - #include #include #include diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp index f51a130f36..30dac05be8 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/forward_as_tuple.pass.cpp @@ -67,11 +67,9 @@ int main(int, char**) { test0(cuda::std::forward_as_tuple()); } -#if !defined(TEST_COMPILER_MSVC_2017) { test1a(cuda::std::forward_as_tuple(1)); } -#endif { int i = 2; test1b(cuda::std::forward_as_tuple(i)); diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp index c4970eb21b..047f8d22ee 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.creation/tuple_cat.pass.cpp @@ -78,7 +78,6 @@ int main(int, char**) unused(t); // Prevent unused warning } */ -#if !defined(TEST_COMPILER_MSVC_2017) { constexpr cuda::std::tuple t1(1); constexpr cuda::std::tuple t = cuda::std::tuple_cat(t1); @@ -91,15 +90,12 @@ int main(int, char**) static_assert(cuda::std::get<1>(t) == 1, ""); } #endif -#endif -#if !defined(TEST_COMPILER_MSVC_2017) { cuda::std::tuple t = cuda::std::tuple_cat(cuda::std::tuple(1, 2)); assert(cuda::std::get<0>(t) == 1); assert(cuda::std::get<1>(t) == 2); } -#endif // cuda::std::array not supported /* { @@ -109,13 +105,11 @@ int main(int, char**) assert(cuda::std::get<2>(t) == 0); } */ -#if !defined(TEST_COMPILER_MSVC_2017) { cuda::std::tuple t = cuda::std::tuple_cat(cuda::std::pair(2, 1)); assert(cuda::std::get<0>(t) == 2); assert(cuda::std::get<1>(t) == 1); } -#endif { cuda::std::tuple<> t1; cuda::std::tuple<> t2; @@ -164,7 +158,6 @@ int main(int, char**) assert(cuda::std::get<1>(t3) == 3.5); assert(cuda::std::get<2>(t3) == nullptr); } -#if !defined(TEST_COMPILER_MSVC_2017) { cuda::std::tuple t1(nullptr, 1); cuda::std::tuple t2(2, 3.5); @@ -275,6 +268,5 @@ int main(int, char**) int, const int, int&, const int&>); unused(r); } -#endif return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp index 7ef111245d..124a9164dc 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.pass.cpp @@ -65,7 +65,6 @@ int main(int, char**) static_assert(noexcept(cuda::std::get<1>(cuda::std::move(p))), ""); } -#if !defined(TEST_COMPILER_MSVC_2017) { int x = 42; int const y = 43; @@ -75,7 +74,6 @@ int main(int, char**) static_assert(cuda::std::is_same(cuda::std::move(p)))>::value, ""); static_assert(noexcept(cuda::std::get<1>(cuda::std::move(p))), ""); } -#endif #if TEST_STD_VER > 11 { diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_rv.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_rv.pass.cpp index f48d59da4d..100876d305 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_rv.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_rv.pass.cpp @@ -37,12 +37,10 @@ int main(int, char**) assert(*p == 3); } */ -#if !defined(TEST_COMPILER_MSVC_2017) { cuda::std::tuple t(3); MoveOnly _m = cuda::std::get<0>(cuda::std::move(t)); assert(_m.get() == 3); } -#endif return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp index dca715e004..dde1b18e32 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.pass.cpp @@ -89,7 +89,6 @@ int main(int, char**) static_assert(noexcept(cuda::std::get(cuda::std::move(t))), ""); } -#if !defined(TEST_COMPILER_MSVC_2017) { int x = 42; int y = 43; @@ -99,7 +98,6 @@ int main(int, char**) static_assert(cuda::std::is_same(cuda::std::move(t)))>::value, ""); static_assert(noexcept(cuda::std::get(cuda::std::move(t))), ""); } -#endif { constexpr const cuda::std::tuple t { 1, 2, 3.4, 5.6 }; static_assert(cuda::std::get(cuda::std::move(t)) == 1, ""); diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp index 2d0533a912..7a1119764b 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.special/non_member_swap.pass.cpp @@ -30,7 +30,6 @@ int main(int, char**) T t1; swap(t0, t1); } -#if !defined(TEST_COMPILER_MSVC_2017) { typedef cuda::std::tuple T; T t0(MoveOnly(0)); @@ -61,6 +60,5 @@ int main(int, char**) assert(cuda::std::get<1>(t1) == 1); assert(cuda::std::get<2>(t1) == 2); } -#endif return 0; } diff --git a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp index e5b3f2f394..1db35af6e2 100644 --- a/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp +++ b/libcudacxx/.upstream-tests/test/std/utilities/tuple/tuple.tuple/tuple.swap/member_swap.pass.cpp @@ -29,7 +29,6 @@ int main(int, char**) T t1; t0.swap(t1); } -#if !defined(TEST_COMPILER_MSVC_2017) { typedef cuda::std::tuple T; T t0(MoveOnly(0)); @@ -60,6 +59,5 @@ int main(int, char**) assert(cuda::std::get<1>(t1) == 1); assert(cuda::std::get<2>(t1) == 2); } -#endif return 0; } diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__functional/bind.h b/libcudacxx/include/cuda/std/detail/libcxx/include/__functional/bind.h index f0b62ff4bc..c90edb8143 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__functional/bind.h +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__functional/bind.h @@ -132,7 +132,7 @@ __enable_if_t > __mu(_Ti& __ti, tuple<_Uj...>& __uj) { - typedef typename __make_tuple_indices::type __indices; + typedef __make_tuple_indices_t __indices; return _CUDA_VSTD::__mu_expand(__ti, __uj, __indices()); } @@ -142,7 +142,7 @@ struct __mu_return2 {}; template struct __mu_return2 { - typedef typename tuple_element::value - 1, _Uj>::type type; + typedef __tuple_element_t::value - 1, _Uj> type; }; template @@ -154,8 +154,8 @@ __enable_if_t > __mu(_Ti&, _Uj& __uj) { - const size_t _Indx = is_placeholder<_Ti>::value - 1; - return _CUDA_VSTD::forward::type>(_CUDA_VSTD::get<_Indx>(__uj)); + const size_t _Indx = is_placeholder<_Ti>::value - 1; + return _CUDA_VSTD::forward<__tuple_element_t<_Indx, _Uj>>(_CUDA_VSTD::get<_Indx>(__uj)); } template @@ -197,8 +197,7 @@ struct __mu_return_impl<_Ti, false, true, false, tuple<_Uj...> > template struct __mu_return_impl<_Ti, false, false, true, _TupleUj> { - typedef typename tuple_element::value - 1, - _TupleUj>::type&& type; + typedef __tuple_element_t::value - 1, _TupleUj>&& type; }; template @@ -298,7 +297,7 @@ class __bind : public __weak_result_type<__decay_t<_Fp>> _Fd __f_; _Td __bound_args_; - typedef typename __make_tuple_indices::type __indices; + typedef __make_tuple_indices_t __indices; public: template +# include <__config> #endif // __cuda_std__ #include "../__fwd/array.h" @@ -21,70 +21,54 @@ #include "../cstddef" #if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER) -#pragma GCC system_header +# pragma GCC system_header #endif _LIBCUDACXX_BEGIN_NAMESPACE_STD -template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -typename tuple_element<_Ip, tuple<_Tp...> >::type& -get(tuple<_Tp...>&) noexcept; +template +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __tuple_element_t<_Ip, tuple<_Tp...>>& get( + tuple<_Tp...>&) noexcept; -template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const typename tuple_element<_Ip, tuple<_Tp...> >::type& -get(const tuple<_Tp...>&) noexcept; +template +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const __tuple_element_t<_Ip, tuple<_Tp...>>& get( + const tuple<_Tp...>&) noexcept; -template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -typename tuple_element<_Ip, tuple<_Tp...> >::type&& -get(tuple<_Tp...>&&) noexcept; +template +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __tuple_element_t<_Ip, tuple<_Tp...>>&& get( + tuple<_Tp...>&&) noexcept; -template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const typename tuple_element<_Ip, tuple<_Tp...> >::type&& -get(const tuple<_Tp...>&&) noexcept; +template +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const __tuple_element_t<_Ip, tuple<_Tp...>>&& get( + const tuple<_Tp...>&&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -typename tuple_element<_Ip, pair<_T1, _T2> >::type& -get(pair<_T1, _T2>&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __tuple_element_t<_Ip, pair<_T1, _T2>>& get( + pair<_T1, _T2>&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const typename tuple_element<_Ip, pair<_T1, _T2> >::type& -get(const pair<_T1, _T2>&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const __tuple_element_t<_Ip, pair<_T1, _T2>>& get( + const pair<_T1, _T2>&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -typename tuple_element<_Ip, pair<_T1, _T2> >::type&& -get(pair<_T1, _T2>&&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 __tuple_element_t<_Ip, pair<_T1, _T2>>&& get( + pair<_T1, _T2>&&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const typename tuple_element<_Ip, pair<_T1, _T2> >::type&& -get(const pair<_T1, _T2>&&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const __tuple_element_t<_Ip, pair<_T1, _T2>>&& get( + const pair<_T1, _T2>&&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -_Tp& -get(array<_Tp, _Size>&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _Tp& get(array<_Tp, _Size>&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const _Tp& -get(const array<_Tp, _Size>&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const _Tp& get(const array<_Tp, _Size>&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -_Tp&& -get(array<_Tp, _Size>&&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 _Tp&& get(array<_Tp, _Size>&&) noexcept; template -_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 -const _Tp&& -get(const array<_Tp, _Size>&&) noexcept; +_LIBCUDACXX_INLINE_VISIBILITY _LIBCUDACXX_CONSTEXPR_AFTER_CXX11 const _Tp&& get(const array<_Tp, _Size>&&) noexcept; _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/apply_cv.h b/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/apply_cv.h index 06de3942f9..ff670542dd 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/apply_cv.h +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/apply_cv.h @@ -11,7 +11,7 @@ #define _LIBCUDACXX___TUPLE_APPLY_CV_H #ifndef __cuda_std__ -#include <__config> +# include <__config> #endif // __cuda_std__ #include "../__type_traits/is_const.h" @@ -20,7 +20,7 @@ #include "../__type_traits/remove_reference.h" #if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER) -#pragma GCC system_header +# pragma GCC system_header #endif _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -28,42 +28,58 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD template struct __apply_cv_mf; template <> -struct __apply_cv_mf { - template using __apply = _Tp; +struct __apply_cv_mf +{ + template + using __apply = _Tp; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = _Tp&; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = _Tp&; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp&; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = const _Tp&; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp&; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = volatile _Tp&; }; template <> -struct __apply_cv_mf { - template using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp&; +struct __apply_cv_mf +{ + template + using __apply _LIBCUDACXX_NODEBUG_TYPE = const volatile _Tp&; }; template > -using __apply_cv_t _LIBCUDACXX_NODEBUG_TYPE = __apply_cv_mf< - is_lvalue_reference<_Tp>::value, - is_const<_RawTp>::value, - is_volatile<_RawTp>::value>; +using __apply_cv_t _LIBCUDACXX_NODEBUG_TYPE = + __apply_cv_mf<_LIBCUDACXX_TRAIT(is_lvalue_reference, _Tp), + _LIBCUDACXX_TRAIT(is_const, _RawTp), + _LIBCUDACXX_TRAIT(is_volatile, _RawTp)>; _LIBCUDACXX_END_NAMESPACE_STD diff --git a/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/make_tuple_types.h b/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/make_tuple_types.h index ba9dbb9e80..6c3a4d1482 100644 --- a/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/make_tuple_types.h +++ b/libcudacxx/include/cuda/std/detail/libcxx/include/__tuple_dir/make_tuple_types.h @@ -11,7 +11,7 @@ #define _LIBCUDACXX___TUPLE_MAKE_TUPLE_TYPES_H #ifndef __cuda_std__ -#include <__config> +# include <__config> #endif // __cuda_std__ #include "../__fwd/array.h" @@ -26,7 +26,7 @@ #include "../cstddef" #if defined(_LIBCUDACXX_USE_PRAGMA_GCC_SYSTEM_HEADER) -#pragma GCC system_header +# pragma GCC system_header #endif _LIBCUDACXX_BEGIN_NAMESPACE_STD @@ -39,46 +39,49 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD template struct __make_tuple_types_flat; -template