implement == and != operators on the value_null struct - no functional change, but helpful to consolidate logic for comparisions

This commit is contained in:
Dane Springmeyer 2013-05-31 12:24:59 -07:00
parent 6826920c53
commit 1da3bee032
2 changed files with 10 additions and 24 deletions

View file

@ -115,12 +115,6 @@ struct equals
return (lhs == rhs) ? true: false;
}
bool operator() (value_null, value_null) const
{
// this changed from false to true - https://github.com/mapnik/mapnik/issues/794
return true;
}
template <typename T>
bool operator() (T lhs, T rhs) const
{
@ -185,24 +179,6 @@ struct not_equals
return (lhs != rhs)? true : false;
}
bool operator() (value_null, value_null) const
{
return false;
}
template <typename T>
bool operator() (value_null, const T &) const
{
// https://github.com/mapnik/mapnik/issues/1642
return true;
}
template <typename T>
bool operator() (const T &, value_null) const
{
// https://github.com/mapnik/mapnik/issues/1642
return true;
}
};
struct greater_than

View file

@ -47,6 +47,16 @@ typedef bool value_bool;
struct value_null
{
bool operator==(value_null const& other) const
{
return true;
}
bool operator!=(value_null const& other) const
{
return false;
}
template <typename T>
value_null operator+ (T const& /*other*/) const
{