If you have a header file, say "test.h" , including
namespace test
{
enum ids
{
a = 1,
b = 2,
c = 3,
d = 30
};
char *names[50];
};
and the source file "test.cc" basically including
test::names[test::a] = "yum yum";
test::names[test::c] = "pum pum";
Wouldn't it make sense to wrap an implementation inside a namespace?
I would say that this would be because it is after the implementation of the header file, so it would be advisable to include the implementation in the same namespace as the header, without manually prefixing each variable with test::and without prefixing when using values from the outside.
This is the opinion of a C ++ newbie, what could more intelligent people say here?
Luken source
share