11/*
2- * Copyright (c) 2023, NVIDIA CORPORATION.
2+ * Copyright (c) 2023-2025 , NVIDIA CORPORATION.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -26,8 +26,8 @@ struct tuple_size<volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>>
2626template <typename T1, typename T2>
2727struct tuple_size <const volatile cuco::pair<T1, T2>> : tuple_size<cuco::pair<T1, T2>> {};
2828
29- template <std::size_t I , typename T1, typename T2>
30- struct tuple_element <I , cuco::pair<T1, T2>> {
29+ template <std::size_t Index , typename T1, typename T2>
30+ struct tuple_element <Index , cuco::pair<T1, T2>> {
3131 using type = void ;
3232};
3333
@@ -61,48 +61,48 @@ template <typename T1, typename T2>
6161struct tuple_element <1 , const volatile cuco::pair<T1, T2>> : tuple_element<1 , cuco::pair<T1, T2>> {
6262};
6363
64- template <std::size_t I , typename T1, typename T2>
64+ template <std::size_t Index , typename T1, typename T2>
6565__host__ __device__ constexpr auto get (cuco::pair<T1, T2>& p) ->
66- typename tuple_element<I , cuco::pair<T1, T2>>::type&
66+ typename tuple_element<Index , cuco::pair<T1, T2>>::type&
6767{
68- static_assert (I < 2 );
69- if constexpr (I == 0 ) {
68+ static_assert (Index < 2 );
69+ if constexpr (Index == 0 ) {
7070 return p.first ;
7171 } else {
7272 return p.second ;
7373 }
7474}
7575
76- template <std::size_t I , typename T1, typename T2>
76+ template <std::size_t Index , typename T1, typename T2>
7777__host__ __device__ constexpr auto get (cuco::pair<T1, T2>&& p) ->
78- typename tuple_element<I , cuco::pair<T1, T2>>::type&&
78+ typename tuple_element<Index , cuco::pair<T1, T2>>::type&&
7979{
80- static_assert (I < 2 );
81- if constexpr (I == 0 ) {
80+ static_assert (Index < 2 );
81+ if constexpr (Index == 0 ) {
8282 return cuda::std::move (p.first );
8383 } else {
8484 return cuda::std::move (p.second );
8585 }
8686}
8787
88- template <std::size_t I , typename T1, typename T2>
88+ template <std::size_t Index , typename T1, typename T2>
8989__host__ __device__ constexpr auto get (cuco::pair<T1, T2> const & p) ->
90- typename tuple_element<I , cuco::pair<T1, T2>>::type const &
90+ typename tuple_element<Index , cuco::pair<T1, T2>>::type const &
9191{
92- static_assert (I < 2 );
93- if constexpr (I == 0 ) {
92+ static_assert (Index < 2 );
93+ if constexpr (Index == 0 ) {
9494 return p.first ;
9595 } else {
9696 return p.second ;
9797 }
9898}
9999
100- template <std::size_t I , typename T1, typename T2>
100+ template <std::size_t Index , typename T1, typename T2>
101101__host__ __device__ constexpr auto get (cuco::pair<T1, T2> const && p) ->
102- typename tuple_element<I , cuco::pair<T1, T2>>::type const &&
102+ typename tuple_element<Index , cuco::pair<T1, T2>>::type const &&
103103{
104- static_assert (I < 2 );
105- if constexpr (I == 0 ) {
104+ static_assert (Index < 2 );
105+ if constexpr (Index == 0 ) {
106106 return cuda::std::move (p.first );
107107 } else {
108108 return cuda::std::move (p.second );
0 commit comments