Skip to content

Instantly share code, notes, and snippets.

@djg djg/hack_enum.cpp
Created May 21, 2010

Embed
What would you like to do?
enum Flags
{
Flag1 = 0x1,
Flag2 = 0x2,
Flag3 = 0x4,
Flag4 = 0x8
};
Flags operator|(Flags a, Flags b)
{
return Flags((int)a | (int)b);
}
int main()
{
Flags f = Flag1 | Flag2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.