小编Gle*_*enn的帖子

什么是嵌套名称说明符?

相关

我想知道嵌套名称说明符究竟是什么?我在草稿中查了一下但是我能理解语法,因为我还没有学过任何编译器设计课程.

void S(){}

struct S{
   S(){cout << 1;}
   void f(){}
   static const int x = 0;
}; 

int main(){ 
   struct S *p = new struct ::S;  
   p->::S::f();

   S::x;  

   ::S(); // Is ::S a nested name specifier?
   delete p;
} 
Run Code Online (Sandbox Code Playgroud)

c++ names

29
推荐指数
2
解决办法
4万
查看次数

标签 统计

c++ ×1

names ×1