Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does it mean by "indirectly declaring a namespace within another namespace"?

Tags:

c++

c++14

[basic.link] paragraph 4 in the C++14 Standard:

An unnamed namespace or a namespace declared directly or indirectly within an unnamed namespace has internal linkage. All other namespaces have external linkage. A name having namespace scope that has not been given internal linkage above has the same linkage as the enclosing namespace if it is the name of ...

What does it mean by "indirectly declaring a namespace within another namespace" above?

like image 577
Alexander Avatar asked Oct 27 '15 20:10

Alexander


1 Answers

It means a namespace nested inside an unnamed namespace, so either a namespace declared as a member of an unnamed namespace, or declared as a member of a namespace declared as a member of an unnamed namespace, or so on.

like image 126
Brian Bi Avatar answered Oct 20 '22 18:10

Brian Bi