#pragma once #include enum class DisplayMode { None = 0, ShowHexIdent = 1 << 0, ZeroExtend = 1 << 1, AllHex = ShowHexIdent | ZeroExtend, }; inline DisplayMode operator|(DisplayMode lhs, DisplayMode rhs) { using T = std::underlying_type::type; return static_cast(static_cast(lhs) | static_cast(rhs)); } inline DisplayMode & operator|=(DisplayMode & lhs, DisplayMode rhs) { lhs = lhs | rhs; return lhs; } inline DisplayMode operator&(DisplayMode lhs, DisplayMode rhs) { using T = std::underlying_type::type; return static_cast(static_cast(lhs) & static_cast(rhs)); } inline DisplayMode & operator&=(DisplayMode & lhs, DisplayMode rhs) { lhs = lhs & rhs; return lhs; } inline DisplayMode operator^(DisplayMode lhs, DisplayMode rhs) { using T = std::underlying_type::type; return static_cast((static_cast(lhs) ^ static_cast(rhs)) & static_cast(DisplayMode::AllHex)); } inline DisplayMode & operator^=(DisplayMode & lhs, DisplayMode rhs) { lhs = lhs ^ rhs; return lhs; } inline DisplayMode operator~(DisplayMode lhs) { using T = std::underlying_type::type; return static_cast(~static_cast(lhs) & static_cast(DisplayMode::AllHex)); }