From 49e122a81d7d1d530eae2c72a33df3ab6014ecaa Mon Sep 17 00:00:00 2001
From: Max Kellermann <mk@cm4all.com>
Date: Thu, 1 Dec 2022 16:18:40 +0100
Subject: [PATCH] util/IntrusiveHashSet: add method remove_and_dispose_if(key)

---
 src/util/IntrusiveHashSet.hxx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/util/IntrusiveHashSet.hxx b/src/util/IntrusiveHashSet.hxx
index f2b686681..a47f04595 100644
--- a/src/util/IntrusiveHashSet.hxx
+++ b/src/util/IntrusiveHashSet.hxx
@@ -208,6 +208,15 @@ public:
 			bucket.remove_and_dispose_if(pred, disposer);
 	}
 
+	constexpr void remove_and_dispose_if(const auto &key,
+					     Predicate<const_reference> auto pred,
+					     Disposer<value_type> auto disposer) noexcept {
+		static_assert(!constant_time_size, "Not yet implemented");
+
+		auto &bucket = GetBucket(key);
+		bucket.remove_and_dispose_if(pred, disposer);
+	}
+
 	[[nodiscard]]
 	static constexpr bucket_iterator iterator_to(reference item) noexcept {
 		return Bucket::iterator_to(item);