mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Add helper methods to FlagsEnum where I can make sure that it actually works forsenT
This commit is contained in:
parent
a0d8ace515
commit
7d4cebbc96
1 changed files with 12 additions and 1 deletions
|
@ -12,7 +12,7 @@ class FlagsEnum
|
|||
{
|
||||
public:
|
||||
FlagsEnum()
|
||||
: value((T)0)
|
||||
: value(static_cast<T>(0))
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,18 @@ public:
|
|||
return (T &)((Q &)this->value ^= (Q)a);
|
||||
}
|
||||
|
||||
void EnableFlag(T flag)
|
||||
{
|
||||
reinterpret_cast<Q &>(this->value) |= static_cast<Q>(flag);
|
||||
}
|
||||
|
||||
bool HasFlag(Q flag) const
|
||||
{
|
||||
return (this->value & flag) == flag;
|
||||
}
|
||||
|
||||
T value;
|
||||
};
|
||||
|
||||
} // namespace util
|
||||
} // namespace chatterino
|
||||
|
|
Loading…
Reference in a new issue