I noticed that if I do something similar in C ++ using Microsoft Visual Studio Express 2013:
namespace LogLevelEnum { enum Type { ALL, FINEST, FINE, INFO, WARNING, SEVERE, OFF }; } typedef LogLevelEnum::Type LogLevel;
I can access enum elements using things like LogLevel::INFO and LogLevel::WARNING , but not just using INFO or WARNING . I like it because it doesn't put as many characters in the covered namespace.
However, I was wondering if this is standard behavior. I know that classes and namespaces can be indexed using the :: operator, but this makes little sense for working with enumerations, as they simply reset everything in the namespace.
source share