0

Consider an enum class

enum class FOO
{
  A,B,C
};

struct something
{
  FOO abc = FOO::A; //Compiler Doesnt like this
}

int main(){
  something _something;
  return 0;
}

So the compiler doesnt like the initialisation and gives me 3 different errors.

Error C2238 unexpected token(s) preceding ';'

Error C2059 syntax error: '='

Error C2653 'FOO': is not a class or namespace name


Compiler:

Visual C++

Build Tools MsVC142

So am I initialisation the enum incorrectly? or am i completely missing something.

Timo
  • 9,269
  • 2
  • 28
  • 58

0 Answers0