From 9e6303e86dae25096ee62d74abfca4456be6a96f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 7 Apr 2015 14:51:53 +0200 Subject: Initial support for amalgamation/subprojects For now both need to be manually specified in src bootstrap. At this stage main() loads any outer root scopes while include loads any inner. --- build/variable | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'build/variable') diff --git a/build/variable b/build/variable index 500cc00..aca0bed 100644 --- a/build/variable +++ b/build/variable @@ -240,6 +240,23 @@ namespace build return value_proxy (&base::operator[] (v), &scope_); } + value_proxy + operator[] (const std::string& v) const + { + return operator[] (variable_pool.find (v)); + } + + value_proxy + operator[] (const variable& v) const + { + auto i (find (v)); + return i != end () + // @@ To do this properly we seem to need ro_value_proxy. + // + ? value_proxy (&const_cast (i->second), &scope_) + : value_proxy (nullptr, nullptr); + } + std::pair find_namespace (const std::string& ns) { -- cgit v1.1