范围枚举的Elaborated-type-specifier不能使用'class'关键字 [英] Elaborated-type-specifier for a scoped enum must not use the ‘class’ keyword

查看:1285
本文介绍了范围枚举的Elaborated-type-specifier不能使用'class'关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下枚举规范:

pre $ enum class FaceDirection:int8
{
Down,
up
};

g ++ 4.8.1给出以下错误:


警告:范围枚举的详细说明符不能使用'class'关键字



<

解决方案

检查您正在派生的类型 enum class 存在。在这种情况下,没有为 int8 指定typedef。


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?

解决方案

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

这篇关于范围枚举的Elaborated-type-specifier不能使用'class'关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆