diff --git a/lib/base/value.cpp b/lib/base/value.cpp index 8094fe6ea..5a6bfa9ea 100644 --- a/lib/base/value.cpp +++ b/lib/base/value.cpp @@ -198,6 +198,19 @@ ValueType Value::GetType(void) const return static_cast(m_Value.which()); } +bool Value::operator==(bool rhs) +{ + if (!IsScalar()) + return false; + + return static_cast(*this) == rhs; +} + +bool Value::operator!=(bool rhs) +{ + return !(*this == rhs); +} + bool Value::operator==(int rhs) { if (!IsScalar()) diff --git a/lib/base/value.h b/lib/base/value.h index 777b7d86f..ecac6ee86 100644 --- a/lib/base/value.h +++ b/lib/base/value.h @@ -73,6 +73,9 @@ public: operator double(void) const; operator String(void) const; + bool operator==(bool rhs); + bool operator!=(bool rhs); + bool operator==(int rhs); bool operator!=(int rhs);