aboutsummaryrefslogtreecommitdiff
path: root/build2/variable
diff options
context:
space:
mode:
Diffstat (limited to 'build2/variable')
-rw-r--r--build2/variable10
1 files changed, 9 insertions, 1 deletions
diff --git a/build2/variable b/build2/variable
index 14bf7af..ebf0f02 100644
--- a/build2/variable
+++ b/build2/variable
@@ -28,6 +28,14 @@ namespace build2
const char* name; // Type name for diagnostics.
const size_t size; // Type size in value::data_ (only used for PODs).
+ // Base type, if any. We have very limited support for inheritance: a
+ // const value (but not non-const) can be cast to the base type. In
+ // particular, a derived/base value cannot be assigned to base/derived.
+ // If not NULL, then the cast function below is expected to return the
+ // base pointer if its second argument points to the base's value_type.
+ //
+ const value_type* base;
+
// Destroy the value. If it is NULL, then the type is assumed to be POD
// with a trivial destructor.
//
@@ -59,7 +67,7 @@ namespace build2
// static_cast to const T*. If it is NULL, then cast data_ directly. Note
// that this function is used for both const and non-const values.
//
- const void* (*const cast) (const value&);
+ const void* (*const cast) (const value&, const value_type*);
// If NULL, then the types are compared as PODs using memcmp().
//