注: 此为英文笔记,如需翻译请私信或留评论
To declare an Enum, this way won’t work. The compiler will throw a compile error since no size is explicitly specified.
enum e;
void Foo (E e);
enum E {
A, B, C};
Instead, in C++11, there are two ways to forward declare an Enum.
- Scoped enumerations
... <