aboutsummaryrefslogtreecommitdiff
path: root/build/variable
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-08 16:24:14 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-08 16:24:14 +0200
commitb4ceb7b6aecb7492b28d7a0f6c53fa657a2cd2e5 (patch)
tree0452343b865b9c87b1f833fa1e2f4d90b249f643 /build/variable
parent6e2e56e8f70faed666a83797cebb96e844650a79 (diff)
Inherit list_value directly from names
Diffstat (limited to 'build/variable')
-rw-r--r--build/variable14
1 files changed, 6 insertions, 8 deletions
diff --git a/build/variable b/build/variable
index 67ec33c..1365d54 100644
--- a/build/variable
+++ b/build/variable
@@ -64,26 +64,24 @@ namespace build
~value () = default;
};
- struct list_value: value
+ struct list_value: value, names
{
- names data;
-
public:
- list_value (names d): data (std::move (d)) {}
- list_value (std::string d) {data.emplace_back (std::move (d));}
+ list_value (names d): names (std::move (d)) {}
+ list_value (std::string d) {emplace_back (std::move (d));}
// Note: stored in name as a directory.
//
- list_value (path d) {data.emplace_back (std::move (d));}
+ list_value (path d) {emplace_back (std::move (d));}
virtual value_ptr
- clone () const {return value_ptr (new list_value (data));}
+ clone () const {return value_ptr (new list_value (*this));}
virtual bool
compare (const value& v) const
{
const list_value* lv (dynamic_cast<const list_value*> (&v));
- return lv != nullptr && data == lv->data;
+ return lv != nullptr && static_cast<const names&> (*this) == *lv;
}
};
typedef std::unique_ptr<list_value> list_value_ptr;