diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-20 15:34:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-04-20 15:34:16 +0200 |
commit | 4c44c914d898af53152addad5530504548175e85 (patch) | |
tree | f319c76b681e44874f887bfb5d085d59aa1e662d /build/variable.ixx | |
parent | a82cdb8fd9ba02034d296769772cdf81244da66a (diff) |
Merge config.cxx.* variables into cxx.* when loading cxx module
Diffstat (limited to 'build/variable.ixx')
-rw-r--r-- | build/variable.ixx | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/build/variable.ixx b/build/variable.ixx index 2cbe519..52272cc 100644 --- a/build/variable.ixx +++ b/build/variable.ixx @@ -37,27 +37,57 @@ namespace build } inline const value_proxy& value_proxy:: - operator+= (std::string v) const + operator= (dir_path v) const { - if (*p == nullptr) - *this = v; - else - as<list_value&> ().emplace_back (std::move (v)); + p->reset (new list_value (std::move (v))); + return *this; + } + inline const value_proxy& value_proxy:: + operator= (nullptr_t) const + { + p->reset (); return *this; } inline const value_proxy& value_proxy:: - operator= (dir_path v) const + operator+= (const value_proxy& v) const { - p->reset (new list_value (std::move (v))); + if (v && this != &v) + { + if (*p == nullptr) + *this = v; + else + //@@ Assuming it is a list_value. + // + *this += v.as<const list_value&> (); + } + return *this; } inline const value_proxy& value_proxy:: - operator= (nullptr_t) const + operator+= (const list_value& v) const { - p->reset (); + if (*p == nullptr) + *this = value_ptr (new list_value (v)); + else + { + list_value& lv (as<list_value&> ()); + lv.insert (lv.end (), v.begin (), v.end ()); + } + + return *this; + } + + inline const value_proxy& value_proxy:: + operator+= (std::string v) const + { + if (*p == nullptr) + *this = v; + else + as<list_value&> ().emplace_back (std::move (v)); + return *this; } } |