aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index fb9e840..0abc360 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -2122,9 +2122,9 @@ namespace build2
return r;
}
- static void
+ static bool
json_iterate (const value& val,
- const function<void (value&&, bool first)>& f)
+ const function<bool (value&&, bool first)>& f)
{
// Implement in terms of subscript for consistency (in particular,
// iterating over simple values like number, string).
@@ -2136,8 +2136,11 @@ namespace build2
if (!e.second)
break;
- f (move (e.first), i == 0);
+ if (!f (move (e.first), i == 0))
+ return false;
}
+
+ return true;
}
const json_value value_traits<json_value>::empty_instance;
@@ -3317,10 +3320,13 @@ namespace build2
value_traits<vector<pair<string, optional<string>>>>;
template struct LIBBUILD2_DEFEXPORT
+ value_traits<vector<pair<string, optional<bool>>>>;
+
+ template struct LIBBUILD2_DEFEXPORT
value_traits<vector<pair<optional<string>, string>>>;
template struct LIBBUILD2_DEFEXPORT
- value_traits<vector<pair<string, optional<bool>>>>;
+ value_traits<vector<pair<optional<string>, bool>>>;
template struct LIBBUILD2_DEFEXPORT value_traits<set<string>>;
template struct LIBBUILD2_DEFEXPORT value_traits<set<json_value>>;