util/IntrusiveHashSet: add erase_and_dispose()

This commit is contained in:
Max Kellermann 2022-11-21 10:23:59 +01:00 committed by Max Kellermann
parent 72c047f4f0
commit 3aa959eda7

View File

@ -224,6 +224,13 @@ public:
return GetSlot(*i).erase(i);
}
constexpr slot_iterator erase_and_dispose(slot_iterator i,
auto &&disposer) noexcept {
auto result = erase(i);
disposer(&*i);
return result;
}
[[nodiscard]] [[gnu::pure]]
constexpr slot_iterator find(const auto &key) noexcept {
auto &slot = GetSlot(key);