Point from C ++ 0x draft: n3290

Point from the draft standard N3290 of the ISO standard, ยง3.4.1 / 12:

When searching for the name used in the constant expression of an enumerator definition, previously declared enumeration enumerations are visible and hide the names of objects declared in areas of the block, class, or namespace containing the enumeration qualifier.

This is an added new point, can someone explain this point with an example (from the point of view of an example)?

+4
source share
1 answer

Just enter the code:

struct X {}; enum Foo { X = 0, Y, Z = X // X refers to the enum, not the type }; 
+10
source

All Articles