diff options
Diffstat (limited to 'libbuild2/variable.hxx')
-rw-r--r-- | libbuild2/variable.hxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 9c1e02c..6047bf3 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -1645,8 +1645,23 @@ namespace build2 pair<value&, bool> insert (const variable&, bool typed = true, bool reset_extra = true); - // Note: does not deal with aliases. + // Note: the following functions do not deal with aliases. // + const_iterator + find (const variable& var) const + { + return const_iterator (m_.find (var), *this); + } + + const_iterator + find (const string& name) const + { + const variable* var (ctx != nullptr + ? ctx->var_pool.find (name) + : nullptr); + return var != nullptr ? find (*var) : end (); + } + bool erase (const variable&); |