Multiple namespace declaration in C++

后端 未结 7 1364
无人共我
无人共我 2020-12-28 17:30

Is it legal to replace something like this:

namespace foo {
   namespace bar {
      baz();
   }
}

with something like this:



        
7条回答
  •  梦毁少年i
    2020-12-28 18:11

    As per the grammar in $2.10, an identifier cannot have the token ":". So the name foo::bar is ill-formed.

提交回复
热议问题