diff options
Diffstat (limited to 'src/common/operators.hpp')
-rw-r--r-- | src/common/operators.hpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/common/operators.hpp b/src/common/operators.hpp new file mode 100644 index 0000000..3d44b81 --- /dev/null +++ b/src/common/operators.hpp @@ -0,0 +1,47 @@ +#ifndef OPERATORS_HPP +#define OPERATORS_HPP + +namespace _operators +{ + class Comparable {}; + + template<class T> + bool operator == (T l, T r) + { + return l.value == r.value; + } + + template<class T> + bool operator != (T l, T r) + { + return l.value != r.value; + } + + template<class T> + bool operator < (T l, T r) + { + return l.value < r.value; + } + + template<class T> + bool operator <= (T l, T r) + { + return l.value <= r.value; + } + + template<class T> + bool operator > (T l, T r) + { + return l.value > r.value; + } + + template<class T> + bool operator >= (T l, T r) + { + return l.value >= r.value; + } +} + +using _operators::Comparable; + +#endif // OPERATORS_HPP |