I like to use enum classes, but I use them as flags sometimes and I have to constantly cast to int
if I want to use a bitwise operator. Is there a way to do this without casting? I don't think you can define the operators for them?
If I have functions that take an enum class, do I have to do this?
enum class Flags { FLAG1, FLAG2, FLAG3};
void setFlags(Flags flags){}
int main()
{
setFlags((Flags)((int)Flags::FLAG1 | (int)Flags::FLAG2 | (int)Flags::FLAG3));
}