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

送分小仙女□ 提交于 2019-12-01 13:41:10

问题


I have the following enum specification:

enum class FaceDirection : int8
{
  Down,
  Up
};

g++ 4.8.1 gives the following error:

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

What causes this?


回答1:


Check the type you are deriving the enum class from exists. In this case, there was no typedef specified for int8.



来源:https://stackoverflow.com/questions/20459120/elaborated-type-specifier-for-a-scoped-enum-must-not-use-the-class-keyword

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!