From df43058115b389f1375690812ad92301288f976f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 20 Jul 2016 14:14:52 +0200 Subject: Implement support for <, >, <=, >= in eval context Now can write: if ($build.version > 30000) --- build2/variable | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'build2/variable') diff --git a/build2/variable b/build2/variable index cc99dc6..9473674 100644 --- a/build2/variable +++ b/build2/variable @@ -119,7 +119,7 @@ namespace build2 // value // - enum class value_state: uint8_t {null, empty, filled}; + enum class value_state: uint8_t {null, empty, filled}; // Order is important. class value { @@ -231,10 +231,15 @@ namespace build2 }; // The values should be of the same type (or both be untyped) except NULL - // values can also be untyped. NULL values compare equal. + // values can also be untyped. NULL values compare equal and a NULL value + // is always less than a non-NULL. // bool operator== (const value&, const value&); bool operator!= (const value&, const value&); + bool operator< (const value&, const value&); + bool operator<= (const value&, const value&); + bool operator> (const value&, const value&); + bool operator>= (const value&, const value&); // Value cast. The first three expect the value to be not NULL. The cast // from lookup expects the value to aslo be defined. -- cgit v1.1