From ee2fa47b290190ca89fae3a37ba5c79f8883894f Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Mon, 20 May 2019 11:11:24 +0200 Subject: [PATCH] Remove inheriting TotalOrdering in TypedValue Reviewers: mtomic, mferencevic Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2070 --- src/query/typed_value.hpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/query/typed_value.hpp b/src/query/typed_value.hpp index db68628cd..5597212fc 100644 --- a/src/query/typed_value.hpp +++ b/src/query/typed_value.hpp @@ -14,7 +14,6 @@ #include "storage/edge_accessor.hpp" #include "storage/vertex_accessor.hpp" #include "utils/exceptions.hpp" -#include "utils/total_ordering.hpp" namespace query { @@ -26,8 +25,7 @@ namespace query { * Values can be of a number of predefined types that are enumerated in * TypedValue::Type. Each such type corresponds to exactly one C++ type. */ -class TypedValue - : public utils::TotalOrdering { +class TypedValue { public: /** Custom TypedValue equality function that returns a bool * (as opposed to returning TypedValue as the default equality does). @@ -274,4 +272,20 @@ TypedValue operator^(const TypedValue &a, const TypedValue &b); // stream output std::ostream &operator<<(std::ostream &os, const TypedValue::Type type); +inline TypedValue operator!=(const TypedValue &a, const TypedValue &b) { + return !(a == b); +} + +inline TypedValue operator<=(const TypedValue &a, const TypedValue &b) { + return a < b || a == b; +} + +inline TypedValue operator>(const TypedValue &a, const TypedValue &b) { + return !(a <= b); +} + +inline TypedValue operator>=(const TypedValue &a, const TypedValue &b) { + return !(a < b); +} + } // namespace query