diff --git a/libcudacxx/include/cuda/std/__type_traits/is_arithmetic_integral.h b/libcudacxx/include/cuda/std/__type_traits/is_arithmetic_integral.h index 0d4da7aa3ff..c5f73e6fb8d 100644 --- a/libcudacxx/include/cuda/std/__type_traits/is_arithmetic_integral.h +++ b/libcudacxx/include/cuda/std/__type_traits/is_arithmetic_integral.h @@ -24,6 +24,8 @@ _LIBCUDACXX_BEGIN_NAMESPACE_STD +#if defined(_CCCL_NO_VARIABLE_TEMPLATES) + template struct __is_arithmetic_integral_impl : public false_type {}; @@ -57,24 +59,67 @@ struct __is_arithmetic_integral_impl : public true_type template <> struct __is_arithmetic_integral_impl : public true_type {}; -#ifndef _LIBCUDACXX_HAS_NO_INT128 +# if !defined(_LIBCUDACXX_HAS_NO_INT128) template <> struct __is_arithmetic_integral_impl<__int128_t> : public true_type {}; template <> struct __is_arithmetic_integral_impl<__uint128_t> : public true_type {}; -#endif +# endif // !_LIBCUDACXX_HAS_NO_INT128 template struct _CCCL_TYPE_VISIBILITY_DEFAULT __is_arithmetic_integral : public integral_constant>::value> {}; -#if !defined(_CCCL_NO_VARIABLE_TEMPLATES) +#else // ^^^ _CCCL_NO_VARIABLE_TEMPLATES ^^^ / vvv !_CCCL_NO_VARIABLE_TEMPLATES vvv + template -_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v = __is_arithmetic_integral<_Tp>::value; -#endif // !_CCCL_NO_VARIABLE_TEMPLATES +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = false; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl = true; + +# if !defined(_LIBCUDACXX_HAS_NO_INT128) +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl<__int128_t> = true; + +template <> +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v_impl<__uint128_t> = true; +# endif // !_LIBCUDACXX_HAS_NO_INT128 + +template +_CCCL_INLINE_VAR constexpr bool __is_arithmetic_integral_v = __is_arithmetic_integral_v_impl>; + +#endif // ^^^ !_CCCL_NO_VARIABLE_TEMPLATES ^^^ _LIBCUDACXX_END_NAMESPACE_STD