关于c ++:作用域枚举的Elaborated-type-specifier不得使用“ class”关键字

Elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword

我有以下枚举规范:

1
2
3
4
5
enum class FaceDirection : int8
{
  Down,
  Up
};

g ++ 4.8.1给出以下错误:

warning: elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword

是什么原因造成的?


检查您从中导出enum class的类型是否存在。 在这种情况下,没有为int8指定typedef。