If one has a header file, let's say "test.h" including
namespace test
{
enum ids
{
a = 1,
b = 2,
c = 3,
d = 30
};
char *names[50];
};
and a source file, "test.cc" basically only including
test::names[test::a] = "yum yum";
test::names[test::c] = "pum pum";
// ...
Wouldn't it make more sense to wrap the implementation inside the namespace, too?
I'd say it would, as it's after all the implementation of the header file, so it would make sense to include the implementation in the same namespace as the header without manually prefixing every variable with test::
, and prefix when using values from the outside.
This is the opinion of a C++ rookie, what would the smarter people say here?