aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-09-25 13:40:11 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-09-25 13:40:11 +0200
commitabcd9e4dcd17fe4bd50bc1d48ceccf6a3894986d (patch)
tree38d24b2580b864af04a3b123b3d1448370cd563a /libbuild2/variable.hxx
parent21bd200819d14f5bba18c2a87cccc18743cd7fde (diff)
Use type-aware iteration in script for-loop (GH issue #436)
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r--libbuild2/variable.hxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx
index eebb767..a14c52b 100644
--- a/libbuild2/variable.hxx
+++ b/libbuild2/variable.hxx
@@ -124,12 +124,13 @@ namespace build2
const location& sloc,
const location& bloc);
- // Custom iteration function. It should invoked the specified function for
+ // Custom iteration function. It should invoke the specified function for
// each element in order. If NULL, then the generic implementation is
- // used. The passed value is never NULL.
+ // used. The passed value is never NULL. If the specified function returns
+ // false, then stop the iteration and return false. Otherwise return true.
//
- void (*const iterate) (const value&,
- const function<void (value&&, bool first)>&);
+ bool (*const iterate) (const value&,
+ const function<bool (value&&, bool first)>&);
};
// The order of the enumerators is arranged so that their integral values