From a60da308bfcc003fd07d2b7d848ccb8d166e472a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 11 Apr 2016 14:38:00 +0200 Subject: Redo config inheritance logic --- build2/variable | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build2/variable') 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. // -- cgit v1.1