Why wont this code compile? How do i get this to compile (VC++ 2015)?
typedef enum fpl_InitFlag {
fpl_InitFlag_None = 0,
fpl_InitFlag_Window = 1 << 0,
fpl_InitFlag_VideoOpenGL = 1 << 1,
} fpl_InitFlag;
static void InitSomething(fpl_InitFlag initFlags) {
if (initFlags & fpl_InitFlag_VideoOpenGL) {
initFlags |= fpl_InitFlag_Window;
}
}
int main(int argc, char **args) {
InitSomething(fpl_InitFlag_VideoOpenGL);
return 0;
}
Error C2676 binary '|=': 'fpl_InitFlag' does not define this operator or a conversion to a type acceptable to the predefined operator
Error (active) this operation on an enumerated type requires an applicable user-defined operator function
↧