Skip to content

Commit

Permalink
Ensure that tuple_size is defined (#473)
Browse files Browse the repository at this point in the history
Some compilers have issues trying to instantiate it too early. We can
work around this by adding another SFINAE condition.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
miscco and pre-commit-ci[bot] authored May 3, 2024
1 parent a22d881 commit 6923b3b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/cuco/detail/pair/traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ template <typename T, typename = void>
struct is_cuda_std_pair_like : cuda::std::false_type {};

template <typename T>
struct is_cuda_std_pair_like<
T,
cuda::std::void_t<decltype(cuda::std::get<0>(cuda::std::declval<T>())),
decltype(cuda::std::get<1>(cuda::std::declval<T>()))>>
struct is_cuda_std_pair_like<T,
cuda::std::void_t<decltype(cuda::std::get<0>(cuda::std::declval<T>())),
decltype(cuda::std::get<1>(cuda::std::declval<T>())),
decltype(cuda::std::tuple_size<T>::value)>>
: cuda::std::conditional_t<cuda::std::tuple_size<T>::value == 2,
cuda::std::true_type,
cuda::std::false_type> {};
Expand All @@ -50,10 +50,10 @@ template <typename T, typename = void>
struct is_thrust_pair_like_impl : cuda::std::false_type {};

template <typename T>
struct is_thrust_pair_like_impl<
T,
cuda::std::void_t<decltype(thrust::get<0>(cuda::std::declval<T>())),
decltype(thrust::get<1>(cuda::std::declval<T>()))>>
struct is_thrust_pair_like_impl<T,
cuda::std::void_t<decltype(thrust::get<0>(cuda::std::declval<T>())),
decltype(thrust::get<1>(cuda::std::declval<T>())),
decltype(thrust::tuple_size<T>::value)>>
: cuda::std::conditional_t<thrust::tuple_size<T>::value == 2,
cuda::std::true_type,
cuda::std::false_type> {};
Expand Down

0 comments on commit 6923b3b

Please sign in to comment.