aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index 078c13a..0ec23d3 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -510,7 +510,7 @@ namespace build2
&simple_append<bool>, // Prepend same as append.
&simple_reverse<bool>,
nullptr, // No cast (cast data_ directly).
- nullptr, // No compare (compare as POD).
+ &simple_compare<bool>,
nullptr, // Never empty.
nullptr, // Subscript.
nullptr // Iterate.
@@ -570,7 +570,7 @@ namespace build2
&simple_append<int64_t>, // Prepend same as append.
&simple_reverse<int64_t>,
nullptr, // No cast (cast data_ directly).
- nullptr, // No compare (compare as POD).
+ &simple_compare<int64_t>,
nullptr, // Never empty.
nullptr, // Subscript.
nullptr // Iterate.
@@ -632,7 +632,7 @@ namespace build2
&simple_append<uint64_t>, // Prepend same as append.
&simple_reverse<uint64_t>,
nullptr, // No cast (cast data_ directly).
- nullptr, // No compare (compare as POD).
+ &simple_compare<uint64_t>,
nullptr, // Never empty.
nullptr, // Subscript.
nullptr // Iterate.
@@ -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;