diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-23 13:58:42 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-23 13:58:42 +0200 |
commit | 0d7c7f2c8bc044519b2936c9891d65701b7762bb (patch) | |
tree | ac7a8e6fa338353595589ea8b554486deba260a3 /build2/rule-map | |
parent | c6a07db01dd75c9d39a54b8bcc01ce262245ad52 (diff) |
Make rules const throughout
Diffstat (limited to 'build2/rule-map')
-rw-r--r-- | build2/rule-map | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/build2/rule-map b/build2/rule-map index c1b757b..b7397a0 100644 --- a/build2/rule-map +++ b/build2/rule-map @@ -21,7 +21,7 @@ namespace build2 using target_type_rule_map = std::map< const target_type*, butl::prefix_map<string, // Rule hint. - reference_wrapper<rule>, '.'>>; + reference_wrapper<const rule>, '.'>>; // This is an "indexed map" with operation_id being the index. Entry // with id 0 is a wildcard. @@ -31,7 +31,7 @@ namespace build2 public: template <typename T> void - insert (operation_id oid, const char* hint, rule& r) + insert (operation_id oid, const char* hint, const rule& r) { // 3 is the number of builtin operations. // @@ -69,14 +69,17 @@ namespace build2 template <typename T> void - insert (action_id a, const char* hint, rule& r) + insert (action_id a, const char* hint, const rule& r) { insert<T> (a >> 4, a & 0x0F, hint, r); } template <typename T> void - insert (meta_operation_id mid, operation_id oid, const char* hint, rule& r) + insert (meta_operation_id mid, + operation_id oid, + const char* hint, + const rule& r) { if (mid_ == mid) map_.insert<T> (oid, hint, r); |