在下面的示例中,是否有必要在源文件中使用名称空间A {}还是因为它已经在头文件中完成而具有冗余性?
// header file Foo.h namespace A { class Foo { Foo(); }; } // source file Foo.cpp #include "Foo.h" namespace A { Foo::Foo() {} }
c++ namespaces
c++ ×1
namespaces ×1