diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-11 14:38:00 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-04-11 14:38:00 +0200 |
commit | a60da308bfcc003fd07d2b7d848ccb8d166e472a (patch) | |
tree | 0616ec5db6a3f6dec5d90194c0adca63ad4e8cdb /build2/variable | |
parent | 5417243b54862d0e5f0214dde2b84eb90a100bf2 (diff) |
Redo config inheritance logic
Diffstat (limited to 'build2/variable')
-rw-r--r-- | build2/variable | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build2/variable b/build2/variable index ebf0f02..ea60832 100644 --- a/build2/variable +++ b/build2/variable @@ -119,7 +119,7 @@ namespace build2 // value // - enum class value_state {null, empty, filled}; + enum class value_state: uint8_t {null, empty, filled}; class value { @@ -127,6 +127,13 @@ namespace build2 const value_type* type; // NULL means this value is not (yet) typed. value_state state; + // Extra data that is associated with the value that can be used to store + // flags, etc. It is initialized to 0 and copied (but not assigned) from + // one value to another but is otherwise untouched (not even when the + // value is reset to NULL). + // + uint16_t extra; + bool null () const {return state == value_state::null;} bool empty () const {return state == value_state::empty;} @@ -145,7 +152,7 @@ namespace build2 explicit value (const value_type* t = nullptr) - : type (t), state (value_state::null) {} + : type (t), state (value_state::null), extra (0) {} // Note: preserves type. // |