From bb4f9e6498ba715911f83e0dc221a5b1b86baf51 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 24 Jul 2015 10:32:50 +0200 Subject: Further test module development --- build/variable | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'build/variable') 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 + 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 {return as ();} template <> + inline const name* value_proxy:: + as () const + { + const auto& lv (as ()); + assert (lv.size () < 2); + return lv.empty () ? nullptr : &lv.front (); + } + + template <> std::string& value_proxy:: as () const; -- cgit v1.1