N3290 ISO 标准草案 §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.
这是添加的新点,任何人都可以用一个例子(就例子而言)解释这个点吗?
最佳答案
让我们来写一些代码:
struct X {};
enum Foo
{
X = 0,
Y,
Z = X // X refers to the enum, not the type
};
关于c++ - C++0x 草案 : n3290 中的一点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6120348/