From 5f7c3f923de106f9d204a8f3500274731ae84fd9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 9 Apr 2016 11:38:42 +0200 Subject: Tweak override logic WRT location of overridden value --- build2/variable | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'build2/variable') diff --git a/build2/variable b/build2/variable index 5a33037..77e9db2 100644 --- a/build2/variable +++ b/build2/variable @@ -277,11 +277,15 @@ namespace build2 belongs (const T& x) const {return vars == &x.vars;} lookup (): value (nullptr), vars (nullptr) {} - lookup (const value_type* v, const variable_map* vs) - : value (v), vars (v != nullptr ? vs : nullptr) {} template lookup (const value_type& v, const T& x): lookup (&v, &x.vars) {} + + lookup (const value_type& v, const variable_map& vs) + : value (&v), vars (&vs) {} + + lookup (const value_type* v, const variable_map* vs) + : value (v), vars (v != nullptr ? vs : nullptr) {} }; // Two lookups are equal if they point to the same variable. @@ -735,7 +739,7 @@ namespace build2 const variable_map* stem_vars = nullptr; // NULL means there is no stem. }; - extern std::map, variable_override_value> variable_override_cache; } -- cgit v1.1