Namespaces introduce new declarative regions for declarations, reducing the likelihood of conflicting identifiers with other declarative regions. One feature of namespaces is that they can be further extended, even within separate translation units. For instance, the following declarations are well-formed:.
Code Block |
---|
namespace MyNamespace { int i; } namespace MyNamespace { int i; } void f() { MyNamespace::i = MyNamespace::i = 12; } |
...