diff --git a/src/RemoteTagCache.hxx b/src/RemoteTagCache.hxx index fdaff2770..523321350 100644 --- a/src/RemoteTagCache.hxx +++ b/src/RemoteTagCache.hxx @@ -85,9 +85,9 @@ class RemoteTagCache final { IntrusiveHashSet< Item, 127, - IntrusiveHashSetOperators, - std::equal_to, - Item::GetUri>, + IntrusiveHashSetOperators, + std::equal_to>, IntrusiveHashSetBaseHookTraits, IntrusiveHashSetOptions{.constant_time_size = true}> map; diff --git a/src/input/cache/Manager.hxx b/src/input/cache/Manager.hxx index bf160bb12..40b0e970f 100644 --- a/src/input/cache/Manager.hxx +++ b/src/input/cache/Manager.hxx @@ -32,9 +32,9 @@ class InputCacheManager { IntrusiveList items_by_time; IntrusiveHashSet, - std::equal_to, - ItemGetUri>> items_by_uri; + IntrusiveHashSetOperators, + std::equal_to>> items_by_uri; public: explicit InputCacheManager(const InputCacheConfig &config) noexcept; diff --git a/src/tag/Pool.cxx b/src/tag/Pool.cxx index d48744c97..9d78b5641 100644 --- a/src/tag/Pool.cxx +++ b/src/tag/Pool.cxx @@ -78,9 +78,9 @@ TagPoolItem::Create(TagType type, } static IntrusiveHashSet, - TagPoolItem::GetKey>, + IntrusiveHashSetOperators>, IntrusiveHashSetMemberHookTraits<&TagPoolItem::hash_set_hook>, IntrusiveHashSetOptions{.zero_initialized = true}> tag_pool; diff --git a/src/util/IntrusiveHashSet.hxx b/src/util/IntrusiveHashSet.hxx index 9a578566f..25e929961 100644 --- a/src/util/IntrusiveHashSet.hxx +++ b/src/util/IntrusiveHashSet.hxx @@ -8,6 +8,7 @@ #include // for std::all_of() #include +#include // for std::regular_invocable #include // for std::accumulate() struct IntrusiveHashSetOptions { @@ -94,8 +95,11 @@ struct IntrusiveHashSetMemberHookTraits { * @param GetKey a function object which extracts the "key" part of an * item */ -template +template GetKey, + std::regular_invocable> Hash, + std::predicate, + std::invoke_result_t> Equal> struct IntrusiveHashSetOperators { using hasher = Hash; using key_equal = Equal; diff --git a/test/util/TestIntrusiveHashSet.cxx b/test/util/TestIntrusiveHashSet.cxx index 42d5c1839..f87da73f8 100644 --- a/test/util/TestIntrusiveHashSet.cxx +++ b/test/util/TestIntrusiveHashSet.cxx @@ -39,7 +39,8 @@ TEST(IntrusiveHashSet, Basic) IntItem a{1}, b{2}, c{3}, d{4}, e{5}, f{1}; IntrusiveHashSet> set; { @@ -124,7 +125,8 @@ TEST(IntrusiveHashSet, Multi) IntItem a{1}, b{2}, c{3}, d{4}, e{5}, f{1}; IntrusiveHashSet> set; set.insert(a); @@ -179,15 +181,15 @@ TEST(IntrusiveHashSet, Tag) TaggedItem one{1, 11}, two{2, 22}; IntrusiveHashSet, - std::equal_to, - GetA>, + IntrusiveHashSetOperators, + std::equal_to>, IntrusiveHashSetBaseHookTraits> a; IntrusiveHashSet, - std::equal_to, - GetB>, + IntrusiveHashSetOperators, + std::equal_to>, IntrusiveHashSetBaseHookTraits> b; EXPECT_TRUE(a.empty());