From 323e774380995c04ae705e29ae0e51d62246333d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Nov 2017 17:06:35 +0200 Subject: 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. --- build2/variable.txx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'build2/variable.txx') 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), nullptr, // No base. + &value_traits::value_type, &default_dtor>, &default_copy_ctor>, &default_copy_assign>, @@ -563,6 +564,7 @@ namespace build2 nullptr, // Patched above. sizeof (map), nullptr, // No base. + nullptr, // No element. &default_dtor>, &default_copy_ctor>, &default_copy_assign>, -- cgit v1.1