From 5e51d523e71231cb190e9ed981962df527f4ee7e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 4 Apr 2021 13:11:56 +0200 Subject: Add base functionality for hermetic build configurations --- libbuild2/variable.hxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'libbuild2/variable.hxx') diff --git a/libbuild2/variable.hxx b/libbuild2/variable.hxx index 898648c..d59a891 100644 --- a/libbuild2/variable.hxx +++ b/libbuild2/variable.hxx @@ -1562,6 +1562,14 @@ namespace build2 pair lookup_to_modify (const variable&, bool typed = true); + pair + lookup_namespace (const variable& ns) const + { + auto r (m_.find_sub (ns)); + return make_pair (const_iterator (r.first, *this), + const_iterator (r.second, *this)); + } + // Convert a lookup pointing to a value belonging to this variable map // to its non-const version. Note that this is only safe on the original // values (see find_original()). @@ -1599,13 +1607,10 @@ namespace build2 pair insert (const variable&, bool typed = true); - pair - lookup_namespace (const variable& ns) const - { - auto r (m_.find_sub (ns)); - return make_pair (const_iterator (r.first, *this), - const_iterator (r.second, *this)); - } + // Note: does not deal with aliases. + // + bool + erase (const variable&); const_iterator begin () const {return const_iterator (m_.begin (), *this);} -- cgit v1.1