If you develop a library of functions or classes, put them in a
namesapce, just like std:: namespace in STL.
Don’t put more in global-scope, Learn to using namespace instead
of global.
Don’t put your own class into namesapce std;
Usually, namespace should be your project name, you can add
company name in front of it if you like.
You can use :: to specify global variable name or function if you have same
name in you local scope. Or use Base:: to specify Base scope name if you
have same name in derived class.
Namespaces can be located at the global level or inside othernamespaces. They can’t be placed in a block.. So it has external
linkage by default, that is to say it can be accessed by multi translation
unit(files).
If you have to use using directory in your .cpp file, put it after all the
include files.
unnamed namespace just like static to specify it to local file scope. At the
same time, make anonymous namespace as small as possible. see C++
primer p492