aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/types.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/types.hh')
-rw-r--r--src/libutil/types.hh8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/types.hh b/src/libutil/types.hh
index 22bc2b8dd..bd1dd8bee 100644
--- a/src/libutil/types.hh
+++ b/src/libutil/types.hh
@@ -152,6 +152,14 @@ public:
{
return chunks[idx / ChunkSize][idx % ChunkSize];
}
+
+ template<typename Fn>
+ void forEach(Fn fn) const
+ {
+ for (const auto & c : chunks)
+ for (const auto & e : c)
+ fn(e);
+ }
};
}