#pragma once #define ENUM_CLASS_OPERATORS(type) static inline type operator | (type lhs, type rhs) { \ return static_cast(static_cast(lhs) | static_cast(rhs)); \ } \ static inline type operator & (type lhs, type rhs) { \ return static_cast(static_cast(lhs) & static_cast(rhs)); \ } \ static inline bool operator * (type lhs, type rhs) { \ return (static_cast(lhs) & static_cast(rhs)) != 0; \ } \ static inline type & operator |=(type & lhs, type rhs) { \ reinterpret_cast(lhs) |= static_cast(rhs); \ return lhs; \ }