aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/util.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.hh')
-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 edb7c0fa6..dc38a53ca 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 = "");