aboutsummaryrefslogtreecommitdiff
path: root/build2/operation.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-07 08:09:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit7b9eb752cad04aaadc4552d0f26d307b04af1869 (patch)
treed19cdb450ddec384ec41d9129f8d4afecc14acb7 /build2/operation.cxx
parentbe773edfa2c8f8f3230509bbd713542d20fbb37e (diff)
Pass const target& to recipes
Diffstat (limited to 'build2/operation.cxx')
-rw-r--r--build2/operation.cxx12
1 files changed, 6 insertions, 6 deletions
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<reference_wrapper<target>> psp;
+ vector<reference_wrapper<const target>> psp;
- auto body = [a, quiet, &psp, &trace] (void* v)
+ auto body = [a, quiet, &psp, &trace] (const void* v)
{
- target& t (*static_cast<target*> (v));
+ const target& t (*static_cast<const target*> (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))
{