diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-24 10:32:50 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-24 10:32:50 +0200 |
commit | bb4f9e6498ba715911f83e0dc221a5b1b86baf51 (patch) | |
tree | 021007995d476770b6dced459a770712baa8ea72 /build/variable | |
parent | 3c57a25a4d6a80301ece82ab33f1394e34f8b873 (diff) |
Further test module development
Diffstat (limited to 'build/variable')
-rw-r--r-- | build/variable | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/build/variable b/build/variable index 9009080..368b2f8 100644 --- a/build/variable +++ b/build/variable @@ -175,6 +175,9 @@ namespace build value_proxy (): map (nullptr), p (nullptr) {} value_proxy (value_ptr* p, const variable_map* m): map (m), p (p) {} + template <typename T> + value_proxy (value_ptr& p, const T& x): map (&x.vars), p (&p) {} + void rebind (const value_proxy& x) {map = x.map; p = x.p;} @@ -204,6 +207,15 @@ namespace build as<const list_value&> () const {return as<list_value&> ();} template <> + inline const name* value_proxy:: + as<const name*> () const + { + const auto& lv (as<const list_value&> ()); + assert (lv.size () < 2); + return lv.empty () ? nullptr : &lv.front (); + } + + template <> std::string& value_proxy:: as<std::string&> () const; |