memgraph/utils/total_ordering.hpp
2015-11-21 16:08:23 +01:00

26 lines
476 B
C++

#pragma once
template <class Derived>
struct TotalOrdering
{
friend bool operator!=(const Derived& a, const Derived& b)
{
return !(a == b);
}
friend bool operator<=(const Derived& a, const Derived& b)
{
return a < b || a == b;
}
friend bool operator>(const Derived& a, const Derived& b)
{
return !(a <= b);
}
friend bool operator>=(const Derived& a, const Derived& b)
{
return !(a < b);
}
};