【文件属性】:
文件名称:结合C++11的新特性来解析C++中的枚举与联合
文件大小:102KB
文件格式:PDF
更新时间:2021-01-20 06:13:12
assert clubs const
枚举
枚举是用户定义的类型,其中包含一组称为枚举器的命名的整型常数。
语法
// unscoped enum:
enum [identifier] [: type]
{enum-list};
// scoped enum:
enum [class|struct]
[identifier] [: type]
{enum-list};
// Forward declaration of enumerations (C++11):
enum A : int; // non-scoped enum must have type specified
enum class B; // scoped