#ifndef INCLUDED_BOOST_UTILITY #include #define INCLUDED_BOOST_UTILITY #endif #ifndef INCLUDED_BOOST_TYPETRAITS #include #define INCLUDED_BOOST_TYPETRAITS #endif #include "MyOperators.hpp" class MyInt : boost::operators, boost::operators { bool operator<(const MyInt& x) const; bool operator==(const MyInt& x) const; MyInt& operator+=(const MyInt& x); MyInt& operator-=(const MyInt& x); MyInt& operator*=(const MyInt& x); MyInt& operator/=(const MyInt& x); MyInt& operator%=(const MyInt& x); MyInt& operator|=(const MyInt& x); MyInt& operator&=(const MyInt& x); MyInt& operator^=(const MyInt& x); MyInt& operator++(); MyInt& operator--(); bool operator<(const int& x) const; bool operator==(const int& x) const; MyInt& operator+=(const int& x); MyInt& operator-=(const int& x); MyInt& operator*=(const int& x); MyInt& operator/=(const int& x); MyInt& operator%=(const int& x); MyInt& operator|=(const int& x); MyInt& operator&=(const int& x); MyInt& operator^=(const int& x); }; class YourInt : boost::operators { bool operator<(const YourInt& x) const; bool operator==(const YourInt& x) const; YourInt& operator+=(const YourInt& x); YourInt& operator-=(const YourInt& x); YourInt& operator*=(const YourInt& x); YourInt& operator/=(const YourInt& x); YourInt& operator%=(const YourInt& x); YourInt& operator|=(const YourInt& x); YourInt& operator&=(const YourInt& x); YourInt& operator^=(const YourInt& x); YourInt& operator++(); YourInt& operator--(); }; template typename boost::enable_if, algocpw::is_operators >, void >::type test_operators() { printf("This works, awesome"); } int main() { test_operators(); test_operators(); test_operators(); }