A namespace member can be defined in a namespace that spans an ad namespace:
Members of a named namespace can also be defined outside this namespace by explicit qualification (3.4.3.2) of the designated name, provided that the defined object has already been declared in the namespace and the definition appears after the declaration point in the namespace that spans the namespace declarations .
void f(); namespace N { void ::f() {} }
A class can be defined in a namespace that spans the declaration namespace:
If the head-class name contains a nested name specifier, the class specifier must refer to a class that was previously declared directly in the class or namespace to which the nested name specifier belongs, or to an element of the built-in namespace (7.3.1) of this namespace ( i.e., not just inherited or introduced use-declarations), but the class specifier should appear in the namespace containing the previous declaration . In such cases, the nested class qualifier of the definition-head-name class should not begin with the decltype specifier.
struct A; namespace N { struct ::A {}; }
We also have the same rule for defining member function and defining static data.
So my question is, is overriding (not defining) legal in a namespace that does not include the original declaration?
source share