编译器错误 C2599
“enum”:不允许使用枚举类型的转接声明
编译器不再支持托管枚举的转接声明。
在 /Za 下不允许使用枚举类型的转接声明。
以下示例生成 C2599:
// C2599.cpp
// compile with: /clr /c
enum class Status; // C2599
enum class Status2 { stop2, hold2, go2};
ref struct MyStruct {
// Delete the following line to resolve.
Status m_status;
Status2 m_status2; // OK
};
enum class Status { stop, hold, go };