enum 命名冲突 声明namespace中的enum,调用时Color::Type c = Color::RED;,会隐式转换为int定义结构体中enum,调用时Color c1; c1.xxx(枚举变量);会隐式转换为int定义枚举类enum class Color2{};,默认类型为int,调用时Color2 c2 = Color2::RED;,但在使用时需要用static_cast<int>显式转换可以在枚举类中指定用特定类型存储enumenum class Color3: char;前向声明,并在使用时也使用static_cast<char>显式转换