I am trying to understand an enumeration that is defined using nested qualifiers. What the standard says: N4296:7.2/4 [dcl.enum] :
If the last key is a nested specifier, the enum-specifier must refer to an enumeration that was previously declared directly in the class or namespace to which the nested specifier name (i.e., is not inherited and is not entered using the declaration declaration) , and the enumeration qualifier should appear in the namespace containing the previous declaration.
OK, why does the following example work?
Demo
In namescape C we declared enum E with a declaration, and then referred to it with an enumeration definition. The compiler may have made a mistake, but it is not. What was wrong, where was the misunderstanding?
user2953119
source share