aboutsummaryrefslogtreecommitdiff
path: root/build2/variable
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-05 15:09:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-05 15:09:04 +0200
commit54870fb76b5f59cc2e6d69a8c7a8ef17853a0029 (patch)
tree770b01aa56348ec75f17fb834a2a7123ba9c3f73 /build2/variable
parentef7cb7ea3e6fcb21a4fcf38602b3f43f03232ace (diff)
Add comma, ternary, logical operators support in eval context
Diffstat (limited to 'build2/variable')
-rw-r--r--build2/variable11
1 files changed, 11 insertions, 0 deletions
diff --git a/build2/variable b/build2/variable
index b773047..abff1d5 100644
--- a/build2/variable
+++ b/build2/variable
@@ -248,6 +248,12 @@ namespace build2
reset ();
};
+ // This is what we call a "value pack"; it can be created by the eval
+ // context and passed as arguments to functions. Usually we will have just
+ // one value.
+ //
+ using values = small_vector<value, 1>;
+
// The values should be of the same type (or both be untyped) except NULL
// values can also be untyped. NULL values compare equal and a NULL value
// is always less than a non-NULL.
@@ -439,6 +445,11 @@ namespace build2
//
//template <typename T> T convert (names&&); (declaration causes ambiguity)
+ // Convert value to T. If value is already of type T, then simply cast it.
+ // Otherwise call convert(names) above.
+ //
+ template <typename T> T convert (value&&);
+
// Default implementations of the dtor/copy_ctor/copy_assing callbacks for
// types that are stored directly in value::data_ and the provide all the
// necessary functions (copy/move ctor and assignment operator).