about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.hh3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index edb7c0fa6c60..dc38a53ca2fe 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -17,6 +17,9 @@ namespace nix {
 #define foreach(it_type, it, collection)                                \
     for (it_type it = (collection).begin(); it != (collection).end(); ++it)
 
+#define foreach_reverse(it_type, it, collection)                                \
+    for (it_type it = (collection).rbegin(); it != (collection).rend(); ++it)
+
 
 /* Return an environment variable. */
 string getEnv(const string & key, const string & def = "");