C++11 has support for strongly typed enumerations. To overload for example &, | and > I have provided an example below:
enum class CollisionType : Uint16 { NONE = 0x0000, DYNAMIC = 0x0001, STATIC = 0x0002, KINEMATIC = 0x0004, SENSOR = 0x0008, BULLET = 0x0010, }; inline constexpr CollisionType operator&(CollisionType l, CollisionType r){ return static_cast<CollisionType>(static_cast<Uint16>(l) & static_cast<Uint16>(r)); } inline constexpr bool operator>(CollisionType l, int n){ return static_cast<Uint16>(l) > n; } inline constexpr CollisionType operator|(CollisionType l, CollisionType r){ return static_cast<CollisionType>(static_cast<Uint16>(l) | static_cast<Uint16>(r)); }