From 20677fb264e743b8e5423af31a7d8dc06cf509f6 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 16 Mar 2016 15:27:12 +0200 Subject: Cleanup typed variable assignment --- build2/scope | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'build2/scope') diff --git a/build2/scope b/build2/scope index 158f967..e92361d 100644 --- a/build2/scope +++ b/build2/scope @@ -146,6 +146,10 @@ namespace build2 return vars.assign (name, type).first.get (); } + template + value& + assign (const string& name) {return vars.assign (name).first.get ();} + // Return a value suitable for appending. If the variable does not // exist in this scope's map, then outer scopes are searched for // the same variable. If found then a new variable with the found @@ -156,10 +160,7 @@ namespace build2 append (const variable&); value& - append (const string& name) - { - return append (var_pool.find (name)); - } + append (const string& name) {return append (var_pool.find (name));} // Target type/pattern-specific variables. // -- cgit v1.1