diff options
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. // |