aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-09 17:06:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-09 17:06:35 +0200
commit323e774380995c04ae705e29ae0e51d62246333d (patch)
tree83c18773c1efbfcdb7d3eef77d837880df21dc10 /build2/variable.txx
parent3b0df49b8828921edfb7b764b0628fb164dab852 (diff)
Add support for for-loop
The semantics is similar to the C++11 range-based for: list = 1 2 3 for i: $list print $i Note that there is no scoping of any kind for the loop variable ('i' in the above example). See tests/loop/for.test for some examples/ideas. In the future the plan is to also support more general while-loop as well as break and continue.
Diffstat (limited to 'build2/variable.txx')
-rw-r--r--build2/variable.txx2
1 files changed, 2 insertions, 0 deletions
diff --git a/build2/variable.txx b/build2/variable.txx
index f75ffd6..aebbe1a 100644
--- a/build2/variable.txx
+++ b/build2/variable.txx
@@ -395,6 +395,7 @@ namespace build2
nullptr, // Patched above.
sizeof (vector<T>),
nullptr, // No base.
+ &value_traits<T>::value_type,
&default_dtor<vector<T>>,
&default_copy_ctor<vector<T>>,
&default_copy_assign<vector<T>>,
@@ -563,6 +564,7 @@ namespace build2
nullptr, // Patched above.
sizeof (map<K, V>),
nullptr, // No base.
+ nullptr, // No element.
&default_dtor<map<K, V>>,
&default_copy_ctor<map<K, V>>,
&default_copy_assign<map<K, V>>,