Skip to content

Commit

Permalink
Const& all the things!
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeepyjack committed Oct 4, 2023
1 parent dc71ba0 commit 36d1d5d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions include/cuco/detail/open_addressing/open_addressing_ref_impl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}
Expand All @@ -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_;
}
Expand All @@ -161,7 +161,7 @@ class open_addressing_ref_impl {
*
* @return The key equality predicate
*/
[[nodiscard]] __host__ __device__ constexpr detail::equal_wrapper<key_type, key_equal> key_eq()
[[nodiscard]] __device__ constexpr detail::equal_wrapper<key_type, key_equal> const& key_eq()
const noexcept
{
return this->predicate_;
Expand All @@ -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_;
}
Expand Down Expand Up @@ -695,7 +695,8 @@ class open_addressing_ref_impl {
* @return The key
*/
template <typename Value>
[[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;
Expand Down

0 comments on commit 36d1d5d

Please sign in to comment.