Skip to content

Commit

Permalink
KeyArgBase -> BaseKeyArg
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Dec 30, 2024
1 parent 48c088b commit 94764d2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/momo/HashTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,22 @@ typedef MOMO_DEFAULT_HASH_BUCKET_OPEN HashBucketOpenDefault;

template<typename TKey,
typename THashBucket = HashBucketDefault,
typename TKeyArgBase = TKey>
typename TBaseKeyArg = TKey>
class HashTraits
{
public:
typedef TKey Key;
typedef THashBucket HashBucket;
typedef TKeyArgBase KeyArgBase;
typedef TBaseKeyArg BaseKeyArg;

static const bool isFastNothrowHashable = IsFastNothrowHashable<KeyArgBase>::value;
static const bool isFastNothrowHashable = IsFastNothrowHashable<BaseKeyArg>::value;

template<typename ItemTraits>
using Bucket = typename HashBucket::template Bucket<ItemTraits, !isFastNothrowHashable>;

template<typename KeyArg>
using IsValidKeyArg = typename std::conditional<std::is_same<KeyArgBase, Key>::value,
std::false_type, std::is_convertible<const KeyArg&, const KeyArgBase&>>::type; //?
using IsValidKeyArg = typename std::conditional<std::is_same<BaseKeyArg, Key>::value,
std::false_type, std::is_convertible<const KeyArg&, const BaseKeyArg&>>::type; //?

public:
explicit HashTraits() noexcept
Expand All @@ -161,13 +161,13 @@ class HashTraits
template<typename KeyArg>
size_t GetHashCode(const KeyArg& key) const
{
return HashCoder<KeyArgBase>()(static_cast<const KeyArgBase&>(key));
return HashCoder<BaseKeyArg>()(static_cast<const BaseKeyArg&>(key));
}

template<typename KeyArg1, typename KeyArg2>
bool IsEqual(const KeyArg1& key1, const KeyArg2& key2) const
{
return static_cast<const KeyArgBase&>(key1) == static_cast<const KeyArgBase&>(key2);
return static_cast<const BaseKeyArg&>(key1) == static_cast<const BaseKeyArg&>(key2);
}
};

Expand Down

0 comments on commit 94764d2

Please sign in to comment.