#ifndef BLUE_CORE_MISC_HPP_ #define BLUE_CORE_MISC_HPP_ #define Z__B_ENUM_CLASS_BITWISE_OPS(enum_name) \ inline constexpr enum_name operator&(enum_name x, enum_name y) \ { \ return static_cast( \ static_cast(x) & static_cast(y)); \ } \ \ inline constexpr enum_name operator|(enum_name x, enum_name y) \ { \ return static_cast( \ static_cast(x) | static_cast(y)); \ } \ \ inline constexpr enum_name operator^(enum_name x, enum_name y) \ { \ return static_cast( \ static_cast(x) ^ static_cast(y)); \ } \ \ inline constexpr enum_name operator~(enum_name x) \ { \ return static_cast(~static_cast(x)); \ } \ \ inline enum_name &operator&=(enum_name &x, enum_name y) \ { \ x = x & y; \ return x; \ } \ \ inline enum_name &operator|=(enum_name &x, enum_name y) \ { \ x = x | y; \ return x; \ } \ \ inline enum_name &operator^=(enum_name &x, enum_name y) \ { \ x = x ^ y; \ return x; \ } #endif