util/IntrusiveHashSet: add method remove_and_dispose()
This commit is contained in:
parent
90c3fe22f5
commit
99885c4cbc
@ -188,6 +188,17 @@ public:
|
||||
counter -= bucket.remove_and_dispose_if(pred, disposer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove and dispose all items with the specified key.
|
||||
*/
|
||||
constexpr void remove_and_dispose(const auto &key,
|
||||
Disposer<value_type> auto disposer) noexcept {
|
||||
auto &bucket = GetBucket(key);
|
||||
counter -= bucket.remove_and_dispose_if([this, &key](const auto &item){
|
||||
return equal(key, item);
|
||||
}, disposer);
|
||||
}
|
||||
|
||||
constexpr void remove_and_dispose_if(const auto &key,
|
||||
Predicate<const_reference> auto pred,
|
||||
Disposer<value_type> auto disposer) noexcept {
|
||||
|
Loading…
Reference in New Issue
Block a user