I was looking at this SO question and got to thinking about const ints versus #defines and realized I don\'t actually understand why the compiler can\'t deal with this. Coul
A constant expression is not the same as a const-qualified type value, even though technically the value is known by the compiler at the point of the case
statement.
Imagine what would happen if another file declared extern const int FOO
and tried to use it the same way. The compiler wouldn't know what FOO
was because it was defined in another file. Even though it has a constant value, it is not a constant expression.