Add missing == operator for the Value class.

Refs #5036
This commit is contained in:
Gunnar Beutner 2013-11-08 21:12:22 +01:00
parent e546cd854d
commit 98c3431dda
2 changed files with 16 additions and 0 deletions

View File

@ -198,6 +198,19 @@ ValueType Value::GetType(void) const
return static_cast<ValueType>(m_Value.which()); return static_cast<ValueType>(m_Value.which());
} }
bool Value::operator==(bool rhs)
{
if (!IsScalar())
return false;
return static_cast<double>(*this) == rhs;
}
bool Value::operator!=(bool rhs)
{
return !(*this == rhs);
}
bool Value::operator==(int rhs) bool Value::operator==(int rhs)
{ {
if (!IsScalar()) if (!IsScalar())

View File

@ -73,6 +73,9 @@ public:
operator double(void) const; operator double(void) const;
operator String(void) const; operator String(void) const;
bool operator==(bool rhs);
bool operator!=(bool rhs);
bool operator==(int rhs); bool operator==(int rhs);
bool operator!=(int rhs); bool operator!=(int rhs);