diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-16 15:27:12 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-16 15:27:12 +0200 |
commit | 20677fb264e743b8e5423af31a7d8dc06cf509f6 (patch) | |
tree | f306f7afdff1fc1fc2818d136c631116b8e81c8c /build2/scope | |
parent | cc57e830ac1d85ad588f849d30cdaf54e55ec0d1 (diff) |
Cleanup typed variable assignment
Diffstat (limited to 'build2/scope')
-rw-r--r-- | build2/scope | 9 |
1 files changed, 5 insertions, 4 deletions
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 <typename T> + value& + assign (const string& name) {return vars.assign<T> (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. // |