aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.ixx
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/algorithm.ixx
parentbe773edfa2c8f8f3230509bbd713542d20fbb37e (diff)
Pass const target& to recipes
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r--build2/algorithm.ixx24
1 files changed, 12 insertions, 12 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx
index cf234d8..0c171fd 100644
--- a/build2/algorithm.ixx
+++ b/build2/algorithm.ixx
@@ -173,7 +173,7 @@ namespace build2
}
inline target_state
- execute_delegate (const recipe& r, action a, target& t)
+ execute_delegate (const recipe& r, action a, const target& t)
{
return r (a, t);
}
@@ -181,13 +181,13 @@ namespace build2
// If the first argument is NULL, then the result is treated as a boolean
// value.
//
- pair<target*, target_state>
+ pair<const target*, target_state>
execute_prerequisites (const target_type*,
- action, target&,
+ action, const target&,
const timestamp&, const prerequisite_filter&);
inline pair<bool, target_state>
- execute_prerequisites (action a, target& t,
+ execute_prerequisites (action a, const target& t,
const timestamp& mt, const prerequisite_filter& pf)
{
auto p (execute_prerequisites (nullptr, a, t, mt, pf));
@@ -195,29 +195,29 @@ namespace build2
}
template <typename T>
- inline pair<T*, target_state>
- execute_prerequisites (action a, target& t,
+ inline pair<const T*, target_state>
+ execute_prerequisites (action a, const target& t,
const timestamp& mt, const prerequisite_filter& pf)
{
auto p (execute_prerequisites (T::static_type, a, t, mt, pf));
- return make_pair (static_cast<T*> (p.first), p.second);
+ return make_pair (static_cast<const T*> (p.first), p.second);
}
- inline pair<target*, target_state>
+ inline pair<const target*, target_state>
execute_prerequisites (const target_type& tt,
- action a, target& t,
+ action a, const target& t,
const timestamp& mt, const prerequisite_filter& pf)
{
return execute_prerequisites (&tt, a, t, mt, pf);
}
template <typename T>
- inline pair<T*, target_state>
+ inline pair<const T*, target_state>
execute_prerequisites (const target_type& tt,
- action a, target& t,
+ action a, const target& t,
const timestamp& mt, const prerequisite_filter& pf)
{
auto p (execute_prerequisites (tt, a, t, mt, pf));
- return make_pair (static_cast<T*> (p.first), p.second);
+ return make_pair (static_cast<const T*> (p.first), p.second);
}
}