BAN: Fix HashMaps with custom hashes and comparators

This commit is contained in:
2026-05-20 23:10:25 +03:00
parent d5ee98708b
commit c295af9bd5

View File

@@ -98,7 +98,8 @@ namespace BAN
struct EntryHash struct EntryHash
{ {
constexpr bool operator()(const Key& a) template<detail::HashMapFindable<Key, HASH, COMP> U>
constexpr bool operator()(const U& a)
{ {
return HASH()(a); return HASH()(a);
} }
@@ -110,7 +111,8 @@ namespace BAN
struct EntryComp struct EntryComp
{ {
constexpr bool operator()(const Entry& a, const Key& b) template<detail::HashMapFindable<Key, HASH, COMP> U>
constexpr bool operator()(const Entry& a, const U& b)
{ {
return COMP()(a.key, b); return COMP()(a.key, b);
} }