namespace A {
void b() { /* definition */ }
}
Within namespace A member void
b() is defined internally.A namespace can also define its members externally using explicit qualification on the name being defined. The entity being defined must already be declared in the namespace and the definition must appear after the point of declaration in a namespace that encloses the declaration's namespace.
namespace A {
namespace B {
void f();
}
void B::f() { /* defined outside of B */ }
}
In this example, function f() is declared
within namespace B and defined (outside B)
in A.