summaryrefslogtreecommitdiff
path: root/number.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'number.cpp')
-rw-r--r--number.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/number.cpp b/number.cpp
index 12448de..94ef1ee 100644
--- a/number.cpp
+++ b/number.cpp
@@ -70,6 +70,11 @@ number::to_uint32() const
return (*this == 0) ? 0 : _operands.front();
}
+number::operator bool() const
+{
+ return *this != 0;
+}
+
/* }}} */
/* Operations {{{ */
@@ -226,6 +231,12 @@ number::operator!=(const number &n) const
return _operands != n._operands;
}
+bool
+number::operator!() const
+{
+ return !static_cast<bool>(*this);
+}
+
/* }}} */
/* Assignment operators {{{ */