From f98262e37f608330fcfce799dcacc6fbacac8f8a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 23 Apr 2018 14:25:58 +0200 Subject: Implement forwarded configurations and backlinking --- build2/variable.hxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'build2/variable.hxx') diff --git a/build2/variable.hxx b/build2/variable.hxx index 299ec71..d61bb1c 100644 --- a/build2/variable.hxx +++ b/build2/variable.hxx @@ -96,13 +96,13 @@ namespace build2 enum class variable_visibility { + // Note that the search for target type/pattern-specific terminates at + // the project boundary. + // target, // Target and target type/pattern-specific. scope, // This scope (no outer scopes). project, // This project (no outer projects). normal // All outer scopes. - - // Note that the search for target type/pattern-specific terminates at - // the project boundary. }; // variable @@ -307,7 +307,7 @@ namespace build2 // from lookup expects the value to also be defined. // // Note that a cast to names expects the value to be untyped while a cast - // to vector -- typed. + // to vector -- typed. // // Why are these non-members? The cast is easier on the eyes and is also // consistent with the cast operators. The other two are for symmetry. @@ -1236,6 +1236,13 @@ namespace build2 value& assign (const variable& var) {return insert (var).first;} + value& + assign (const variable* var) // For cached variables. + { + assert (var != nullptr); + return assign (*var); + } + // Note that the variable is expected to have already been registered. // value& -- cgit v1.1