#pragma once #include namespace chatterino { namespace util { // = std::enable_if::value>::type template ::type> class FlagsEnum { public: FlagsEnum() : value((T)0) { } FlagsEnum(T _value) : value(_value) { } inline T operator~() const { return (T) ~(Q)this->value; } inline T operator|(Q a) const { return (T)((Q)a | (Q)this->value); } inline T operator&(Q a) const { return (T)((Q)a & (Q)this->value); } inline T operator^(Q a) const { return (T)((Q)a ^ (Q)this->value); } inline T &operator|=(const Q &a) { return (T &)((Q &)this->value |= (Q)a); } inline T &operator&=(const Q &a) { return (T &)((Q &)this->value &= (Q)a); } inline T &operator^=(const Q &a) { return (T &)((Q &)this->value ^= (Q)a); } T value; }; } // namespace util } // namespace chatterino