From eccb6345f4bb25502607c812406f146d7d373199 Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 9 Jun 2021 09:06:26 -0500 Subject: [PATCH 1/3] Use std::decay_t for make_pair types. --- include/cuco/detail/pair.cuh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/cuco/detail/pair.cuh b/include/cuco/detail/pair.cuh index da50f7258..4eb04ebe9 100644 --- a/include/cuco/detail/pair.cuh +++ b/include/cuco/detail/pair.cuh @@ -133,6 +133,8 @@ using pair_type = cuco::pair; template __host__ __device__ pair_type make_pair(F&& f, S&& s) noexcept { - return pair_type{std::forward(f), std::forward(s)}; + using decayed_F = std::decay_t; + using decayed_S = std::decay_t; + return pair_type{std::forward(f), std::forward(s)}; } } // namespace cuco \ No newline at end of file From 03d9243d931f02cc2b79a5d7e33364d481b4997d Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 9 Jun 2021 09:11:47 -0500 Subject: [PATCH 2/3] Use remove_const on is_thrust_pair like. --- include/cuco/detail/pair.cuh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cuco/detail/pair.cuh b/include/cuco/detail/pair.cuh index 4eb04ebe9..ff9e813ae 100644 --- a/include/cuco/detail/pair.cuh +++ b/include/cuco/detail/pair.cuh @@ -75,8 +75,8 @@ struct is_thrust_pair_like_impl struct is_thrust_pair_like - : is_thrust_pair_like_impl< - std::remove_reference_t()))>> { + : is_thrust_pair_like_impl()))>>> { }; } // namespace detail From 37eca4d01dfd7e7e481057a0d69ee020fab7a335 Mon Sep 17 00:00:00 2001 From: Jake Hemstad Date: Wed, 9 Jun 2021 09:49:14 -0500 Subject: [PATCH 3/3] Use auto return type. --- include/cuco/detail/pair.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cuco/detail/pair.cuh b/include/cuco/detail/pair.cuh index ff9e813ae..8e7bdc594 100644 --- a/include/cuco/detail/pair.cuh +++ b/include/cuco/detail/pair.cuh @@ -131,7 +131,7 @@ using pair_type = cuco::pair; * @return pair_type with first element `f` and second element `s`. */ template -__host__ __device__ pair_type make_pair(F&& f, S&& s) noexcept +__host__ __device__ auto make_pair(F&& f, S&& s) noexcept { using decayed_F = std::decay_t; using decayed_S = std::decay_t;