aboutsummaryrefslogtreecommitdiff
path: root/build/variable
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-28 16:14:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-28 16:14:30 +0200
commitfc1e4124a533b7f628dc00d343b9061367634b27 (patch)
treef2bdf45f35a6c92b6094517dcdb7749259c0bd0a /build/variable
parent56ce5687567150b0b2cc3e57540d564793ef6bf7 (diff)
Second iteration over import/export support
Diffstat (limited to 'build/variable')
-rw-r--r--build/variable10
1 files changed, 10 insertions, 0 deletions
diff --git a/build/variable b/build/variable
index 59db060..0ccd242 100644
--- a/build/variable
+++ b/build/variable
@@ -67,6 +67,8 @@ namespace build
struct list_value: value, names
{
public:
+ using names::names;
+
list_value () = default;
list_value (names d): names (std::move (d)) {}
list_value (std::string d) {emplace_back (std::move (d));}
@@ -87,6 +89,10 @@ namespace build
// value_proxy
//
// A variable can be undefined, null, or contain some actual value.
+ // Note that once value_proxy is bound to a value, the only way to
+ // rebind it to a different value is by using explicit rebind(). In
+ // particular, assigning one value proxy to another will assing the
+ // values.
//
struct variable_map;
@@ -148,8 +154,12 @@ namespace build
//
const variable_map* map; // Variable map to which this value belongs.
+ value_proxy (): map (nullptr), p (nullptr) {}
value_proxy (value_ptr* p, const variable_map* m): map (m), p (p) {}
+ void
+ rebind (const value_proxy& x) {map = x.map; p = x.p;}
+
private:
value_ptr* p;
};