#ifndef GLOBAL_H #define GLOBAL_H #include #include template constexpr inline T operator | (T lhs, T rhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(static_cast(lhs) | static_cast(rhs)); } template constexpr inline T operator & (T lhs, T rhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(static_cast(lhs) & static_cast(rhs)); } template constexpr inline T operator >> (T lhs, T rhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(static_cast(lhs) >> static_cast(rhs)); } template constexpr inline T operator << (T lhs, T rhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(static_cast(lhs) << static_cast(rhs)); } template constexpr inline T operator ~ (T lhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(~static_cast(lhs)); } template constexpr inline T operator ^ (T lhs, T rhs) { static_assert(std::is_enum::value, "template parameter is not an enum type"); return static_cast(static_cast(lhs) ^ static_cast(rhs)); } #endif // GLOBAL_H