A point from C++0x draft : n3290
A point from N3290 draft ISO Standard, §3.4.1/12:
During the lookup of a name used in the constant-expression of an enumerator-definition, previously declared enumerators of the enumeration are visible and hide the names of entities declared in the block, class, or namespace scopes containing the enum-specifier.
This is the added new 开发者_JS百科point, can any one explain this..point with an example (in terms of an example) please?
Let's just have some code:
struct X {};
enum Foo
{
X = 0,
Y,
Z = X // X refers to the enum, not the type
};
精彩评论