#include using namespace std; enum class bits : int { one=1, two=2 }; int operator |( const bits& x,const bits& y ) { return static_cast(x) | static_cast(y); }; int main() { cout << ( bits::one | bits::two ) << '\n'; return 0; }