aboutsummaryrefslogtreecommitdiff
path: root/build/variable
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-07 14:51:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-07 14:51:53 +0200
commit9e6303e86dae25096ee62d74abfca4456be6a96f (patch)
tree58be935e7a1cc2843d251456478d8cc6ec1ad01a /build/variable
parent088a60c512aff26eeb026c516d0afe724880cb2b (diff)
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.
Diffstat (limited to 'build/variable')
-rw-r--r--build/variable17
1 files changed, 17 insertions, 0 deletions
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<value_ptr&> (i->second), &scope_)
+ : value_proxy (nullptr, nullptr);
+ }
+
std::pair<iterator, iterator>
find_namespace (const std::string& ns)
{