diff options
author | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-18 23:34:05 +0000 |
---|---|---|
committer | Dejan Jovanović <dejan.jovanovic@gmail.com> | 2009-12-18 23:34:05 +0000 |
commit | 1b3c2dc36df9d21a9eb7a536627ba37e13540c3a (patch) | |
tree | fe339ff256ac0acc3dcc21bb545bd33cc535cfab /src/expr | |
parent | 9d57ed6b7e78373bec9db88adfb9878e377abb97 (diff) |
More fixes fot the parser tests.
Diffstat (limited to 'src/expr')
-rw-r--r-- | src/expr/expr.cpp | 4 | ||||
-rw-r--r-- | src/expr/expr.h | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/expr/expr.cpp b/src/expr/expr.cpp index ee9334f3c..6cbb41812 100644 --- a/src/expr/expr.cpp +++ b/src/expr/expr.cpp @@ -100,6 +100,10 @@ bool Expr::isNull() const { return d_node->isNull(); } +Expr::operator bool() const { + return !isNull(); +} + void Expr::toStream(std::ostream& out) const { d_node->toStream(out); } diff --git a/src/expr/expr.h b/src/expr/expr.h index 447c35f77..eb4d1ce03 100644 --- a/src/expr/expr.h +++ b/src/expr/expr.h @@ -84,6 +84,11 @@ public: bool operator<(const Expr& e) const; /** + * Returns true if the expression is not the null expression. + */ + operator bool() const; + + /** * Returns the hash value of the expression. Equal expression will have the * same hash value. */ |