diff --git a/Source/Core/Common/BitUtils.h b/Source/Core/Common/BitUtils.h index 8b1b196c24..134ba1fb07 100644 --- a/Source/Core/Common/BitUtils.h +++ b/Source/Core/Common/BitUtils.h @@ -218,6 +218,12 @@ class Flags { public: constexpr Flags() = default; + constexpr ~Flags() = default; + constexpr Flags(const Flags& other) = default; + constexpr Flags(Flags&& other) noexcept = default; + constexpr Flags& operator=(const Flags& other) = default; + constexpr Flags& operator=(Flags&& other) noexcept = default; + constexpr Flags(std::initializer_list bits) { for (auto bit : bits) @@ -225,7 +231,13 @@ public: m_hex |= static_cast>(bit); } } + constexpr Flags(std::underlying_type_t hex) : m_hex(hex) {} + FlagBit operator[](T bit) { return FlagBit(m_hex, bit); } + bool operator[](T bit) const + { + return (m_hex & static_cast>(bit)) != 0; + } std::underlying_type_t m_hex = 0; };