I have an Ah file in which there is a code:
namespace Top { namespace Inner { namespace Bottom { class ClassA { ... } } } } And in another Bh file, similar code:
namespace Top { namespace Inner { namespace Bottom { class ClassB { ... } } } } My question is
Why in different files to describe the same namespace names? Or during compilation or linking they somehow merge into one, and the compiler can understand that if we have the same name in file A and B , then is it the same namespace ? I have a project of more than 20 different files with the same namespace names, but with different classes inside some. In addition, if I want to connect to my project dll , in which I will have ClassC with the same hierarchy of namespaces, will it be considered the same namespace or already different? Why do I need to duplicate the names of spaces in different files?
Can this option be considered valid?
#include "Ah" #include "Bh" void func() { Top::Inner::Bottom::ClassA(); Top::Inner::Bottom::ClassB(); }