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/types.hxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'build2/types.hxx') diff --git a/build2/types.hxx b/build2/types.hxx index f65d054..cf95a9d 100644 --- a/build2/types.hxx +++ b/build2/types.hxx @@ -55,6 +55,8 @@ namespace build2 using std::uint64_t; using std::uintptr_t; + using uint64s = std::vector; + using std::size_t; using std::nullptr_t; @@ -64,6 +66,9 @@ namespace build2 using std::function; using std::reference_wrapper; + using strings = std::vector; + using cstrings = std::vector; + using std::hash; using std::initializer_list; @@ -77,9 +82,6 @@ namespace build2 using butl::vector_view; // using butl::small_vector; // - using strings = vector; - using cstrings = vector; - using std::istream; using std::ostream; -- cgit v1.1