[namespace.unnamed] (original) (raw)
9 Declarations [dcl]
9.9 Namespaces [basic.namespace]
9.9.2 Namespace definition [namespace.def]
9.9.2.2 Unnamed namespaces [namespace.unnamed]
An unnamed-namespace-definition behaves as if it were replaced by
inline namespace unique { }
using namespace unique ;
namespace unique { namespace-body }
whereinline appears if and only if it appears in theunnamed-namespace-definitionand all occurrences of unique in a translation unit are replaced by the same identifier, and this identifier differs from all other identifiers in the translation unit.
[Example 1: namespace { int i; } void f() { i++; } namespace A { namespace { int i; int j; } void g() { i++; } } using namespace A;void h() { i++; A::i++; j++; } — _end example_]