#pragma once #include "alibxx.hpp" namespace A_LIB_NAMESPACE{ namespace Operator { // need operator == template class Equality{ public: friend bool operator!=(const T& x, const O& y) { return !static_cast(x == y); } }; // need operator == and < template class Compare{ public: friend bool operator>(const T& x, const O& y) { return y < x; } friend bool operator<=(const T& x, const O& y) { return !static_cast(y < x); } friend bool operator>=(const T& x, const O& y) { return !static_cast(x < y); } }; // need operator += template class Addable{ public: friend T operator+(const T& x, const O& y) { T res(x); res+= y; return res; } }; template class Subtractable{ public: friend T operator-(const T& x, const O& y) { T res(x); res-= y; return res; } }; } } // A_LIB_NAMESPACE