From 36d1d5d2b51b40fd2b36efe6e451773c4c84a397 Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Wed, 4 Oct 2023 23:25:58 +0000 Subject: [PATCH] Const& all the things! --- .../open_addressing/open_addressing_ref_impl.cuh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh b/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh index 504c00f03..960f741d0 100644 --- a/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh +++ b/include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh @@ -141,7 +141,7 @@ class open_addressing_ref_impl { * * @return The sentinel value used to represent an empty key slot */ - [[nodiscard]] __host__ __device__ constexpr auto empty_key_sentinel() const noexcept + [[nodiscard]] __host__ __device__ constexpr key_type const& empty_key_sentinel() const noexcept { return this->predicate_.empty_sentinel_; } @@ -151,7 +151,7 @@ class open_addressing_ref_impl { * * @return The sentinel value used to represent an empty slot */ - [[nodiscard]] __device__ constexpr value_type empty_slot_sentinel() const noexcept + [[nodiscard]] __device__ constexpr value_type const& empty_slot_sentinel() const noexcept { return empty_slot_sentinel_; } @@ -161,7 +161,7 @@ class open_addressing_ref_impl { * * @return The key equality predicate */ - [[nodiscard]] __host__ __device__ constexpr detail::equal_wrapper key_eq() + [[nodiscard]] __device__ constexpr detail::equal_wrapper const& key_eq() const noexcept { return this->predicate_; @@ -182,7 +182,7 @@ class open_addressing_ref_impl { * * @return The non-owning storage ref of the container */ - [[nodiscard]] __device__ constexpr storage_ref_type storage_ref() const noexcept + [[nodiscard]] __device__ constexpr storage_ref_type const& storage_ref() const noexcept { return storage_ref_; } @@ -695,7 +695,8 @@ class open_addressing_ref_impl { * @return The key */ template - [[nodiscard]] __host__ __device__ constexpr auto extract_key(Value const& value) const noexcept + [[nodiscard]] __host__ __device__ constexpr auto const& extract_key( + Value const& value) const noexcept { if constexpr (this->has_payload) { return value.first;