开发者

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
};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜