The only reason I can think of this is that in C ++, you most likely refer to the name of the base class in the list of constructor initializers, for example:
namespace Two { class B : public One::A { public: B():A() { } }; }
Of course, the target then differs from the target in your example, because you are actually declaring a local variable inside the constructor, whereas in my example A()
refers to an object of type A
, which is implied in the definition of class B
due to inheritance.
However, the situation with my example is likely to happen, so I think they thought they did not require the namespace to be made explicit in this case. As a result, any reference to A
without a namespace is interpreted as a reference to the base class, and not to any other class with the name A
, even if it is in the same namespace as the declaration of B
source share