util/IntrusiveHashSet: add for_each()
This commit is contained in:

committed by
Max Kellermann

parent
3aa959eda7
commit
200b770104
@@ -245,6 +245,18 @@ public:
|
|||||||
return table.front().end();
|
return table.front().end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
constexpr void for_each(auto &&f) {
|
||||||
|
for (auto &bucket : table)
|
||||||
|
for (auto &i : bucket)
|
||||||
|
f(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
constexpr void for_each(auto &&f) const {
|
||||||
|
for (const auto &bucket : table)
|
||||||
|
for (const auto &i : bucket)
|
||||||
|
f(i);
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename K>
|
template<typename K>
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
|
Reference in New Issue
Block a user