From 7b9eb752cad04aaadc4552d0f26d307b04af1869 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Feb 2017 08:09:53 +0200 Subject: Pass const target& to recipes --- build2/operation.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'build2/operation.cxx') diff --git a/build2/operation.cxx b/build2/operation.cxx index 19f1ff7..01f469e 100644 --- a/build2/operation.cxx +++ b/build2/operation.cxx @@ -133,11 +133,11 @@ namespace build2 // Execute collecting postponed targets (to be re-examined later). // Do it in reverse order if the execution mode is 'last'. // - vector> psp; + vector> psp; - auto body = [a, quiet, &psp, &trace] (void* v) + auto body = [a, quiet, &psp, &trace] (const void* v) { - target& t (*static_cast (v)); + const target& t (*static_cast (v)); l5 ([&]{trace << diag_doing (a, t);}); @@ -162,9 +162,9 @@ namespace build2 }; if (current_mode == execution_mode::first) - for (void* v: ts) body (v); + for (const void* v: ts) body (v); else - for (void* v: reverse_iterate (ts)) body (v); + for (const void* v: reverse_iterate (ts)) body (v); // We should have executed every target that we matched. // @@ -175,7 +175,7 @@ namespace build2 // // Note: must be serial. // - for (target& t: psp) + for (const target& t: psp) { switch (execute (a, t)) { -- cgit v1.1