diff --git a/libcudacxx/include/cuda/std/__tuple_dir/make_tuple_types.h b/libcudacxx/include/cuda/std/__tuple_dir/make_tuple_types.h index f2aa4613cc9..f0b81b68a28 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/make_tuple_types.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/make_tuple_types.h @@ -20,7 +20,9 @@ # pragma system_header #endif // no system header +#include #include +#include #include #include #include @@ -61,7 +63,27 @@ struct __make_tuple_types_flat, __tuple_indices<_Idx...>> template using __value_type = _Vt; template > - using __apply_quals = __tuple_types<__type_call<_ApplyFn, __value_type<_Idx>>...>; + using __apply_quals _CCCL_NODEBUG_ALIAS = __tuple_types<__type_call<_ApplyFn, __value_type<_Idx>>...>; +}; + +template +struct __make_tuple_types_flat, __tuple_indices<_Idx...>> +{ + static_assert(sizeof...(_Idx) == 2, "__make_tuple_types: complex has only 2 members"); + template + using __value_type = _Vt; + template > + using __apply_quals _CCCL_NODEBUG_ALIAS = __tuple_types<__type_call<_ApplyFn, __value_type<_Idx>>...>; +}; + +template +struct __make_tuple_types_flat<::cuda::complex<_Vt>, __tuple_indices<_Idx...>> +{ + static_assert(sizeof...(_Idx) == 2, "__make_tuple_types: complex has only 2 members"); + template + using __value_type = _Vt; + template > + using __apply_quals _CCCL_NODEBUG_ALIAS = __tuple_types<__type_call<_ApplyFn, __value_type<_Idx>>...>; }; template #include #include #include @@ -58,6 +59,9 @@ inline constexpr bool __tuple_like_impl> = true; template inline constexpr bool __tuple_like_impl> = true; +template +inline constexpr bool __tuple_like_impl<::cuda::complex<_Tp>> = true; + template inline constexpr bool __tuple_like_impl<::cuda::std::ranges::subrange<_Ip, _Sp, _Kp>> = true; diff --git a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like_ext.h b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like_ext.h index e5637577bd1..663fae47b06 100644 --- a/libcudacxx/include/cuda/std/__tuple_dir/tuple_like_ext.h +++ b/libcudacxx/include/cuda/std/__tuple_dir/tuple_like_ext.h @@ -20,6 +20,7 @@ # pragma system_header #endif // no system header +#include #include #include #include @@ -54,6 +55,9 @@ inline constexpr bool __tuple_like_ext> = true; template inline constexpr bool __tuple_like_ext> = true; +template +inline constexpr bool __tuple_like_ext<::cuda::complex<_Tp>> = true; + template inline constexpr bool __tuple_like_ext<__tuple_types<_Tp...>> = true;