diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/value.cc | 8 | ||||
-rw-r--r-- | src/value.h | 13 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/value.cc b/src/value.cc index 2d6d42d1..b6d4b3f4 100644 --- a/src/value.cc +++ b/src/value.cc @@ -838,7 +838,7 @@ value_t& value_t::operator/=(const value_t& val) } -bool value_t::operator==(const value_t& val) const +bool value_t::is_equal_to(const value_t& val) const { switch (type()) { case VOID: @@ -938,7 +938,7 @@ bool value_t::operator==(const value_t& val) const return *this; } -bool value_t::operator<(const value_t& val) const +bool value_t::is_less_than(const value_t& val) const { switch (type()) { case DATETIME: @@ -992,8 +992,7 @@ bool value_t::operator<(const value_t& val) const return *this; } -#if 0 -bool value_t::operator>(const value_t& val) const +bool value_t::is_greater_than(const value_t& val) const { switch (type()) { case DATETIME: @@ -1041,7 +1040,6 @@ bool value_t::operator>(const value_t& val) const return *this; } -#endif void value_t::in_place_cast(type_t cast_type) { diff --git a/src/value.h b/src/value.h index 3c6c1d41..1fedbba8 100644 --- a/src/value.h +++ b/src/value.h @@ -361,16 +361,21 @@ public: /** * Comparison operators. Values can be compared to other values */ - bool operator==(const value_t& val) const; - bool operator<(const value_t& val) const; + bool is_equal_to(const value_t& val) const; + bool is_less_than(const value_t& val) const; + bool is_greater_than(const value_t& val) const; template <typename T> bool operator==(const T& amt) const { - return *this == value_t(amt); + return is_equal_to(amt); } template <typename T> bool operator<(const T& amt) const { - return *this < value_t(amt); + return is_less_than(amt); + } + template <typename T> + bool operator>(const T& amt) const { + return is_greater_than(amt); } /** |