diff options
author | Marius Kintel <marius@kintel.net> | 2013-06-26 03:39:02 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-06-26 03:39:02 (GMT) |
commit | 1b7cc41a7f454e005ca07815ba463a7fac5e1f8e (patch) | |
tree | 85f0d93ef9d547d17bd536d58e36be575d6ab0b9 /src/value.h | |
parent | d9b3f7b52b3c3d5c21dc11234325739d3e28ee02 (diff) |
Short circuit boolean logic - fixes #411
Diffstat (limited to 'src/value.h')
-rw-r--r-- | src/value.h | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/value.h b/src/value.h index 0445ff4..24e1b45 100644 --- a/src/value.h +++ b/src/value.h @@ -80,12 +80,11 @@ public: bool getVec3(double &x, double &y, double &z, double defaultval = 0.0) const; RangeType toRange() const; + operator bool() const { return this->toBool(); } + Value &operator=(const Value &v); - Value operator!() const; bool operator==(const Value &v) const; bool operator!=(const Value &v) const; - bool operator&&(const Value &v) const; - bool operator||(const Value &v) const; bool operator<(const Value &v) const; bool operator<=(const Value &v) const; bool operator>=(const Value &v) const; @@ -98,16 +97,6 @@ public: Value operator/(const Value &v) const; Value operator%(const Value &v) const; - /* - bool getnum(double &v) const; - bool getv2(double &x, double &y) const; - bool getv3(double &x, double &y, double &z, double defaultval = 0.0) const; - - bool toBool() const; - - void append(Value *val); - */ - friend std::ostream &operator<<(std::ostream &stream, const Value &value) { if (value.type() == Value::STRING) stream << QuotedString(value.toString()); else stream << value.toString(); |