如果有人使用 enum
名称,如下所示:
class Logger
{
public:
enum LEVEL
{
Debug,
Warning,
Notification,
Error
};
};
这件事在这里意味着什么:
Logger(LEVEL);
最佳答案
这看起来像一个构造函数的声明,使用方式如下:
struct Logger
{
enum LEVEL { Debug, Warning, Notification, Error };
Logger(LEVEL);
// ...
};
Logger wlogger(Logger::Warning);
Logger elogger(Logger::Error);
关于c++ - 使用枚举名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9859532/