注入类名称表示不完整和完整类型

时间:2014-06-19 18:37:19

标签: c++ class language-lawyer

请考虑以下代码段:

class A
{
    void foo(){ A a; }//1.  Ok, because A is complete type here
    int b[A::c];//2. Error, because incomplete type denoted by A does not contain c as a member.
    static const int c = 6;
}

关于这种行为,我假设//1//2中的A实际上指的是不同的实体。但在A的名称查找过程(3.4.1,非限定名称查找)期间,//1中将找到相同的 注入的类名 //2。这很好奇。

你可以解释一下吗?

我想从标准中找到规范性的参考资料。

0 个答案:

没有答案
相关问题