Namespace best practice
-
Hi all,
I'm going to refactor a few classes in my project to belong all to the same namespace. Each class has its own header and implementation file. I'm just curious to know which is the best practice to contain all of them in a single namespace, do I have to create a "namespace" file like:@
namespace mySpace{
class MyClassA;
class MyClassB;
}@or add the namespace block in each header file or what? Any suggestion is welcome.
-
Namespaces allows you to combine a set of similar classes (or not similar classes but library - remember namespace std) into one group.
I think it's not very useful to put each class into separate namespace...
Of course namespace can help you with potential ambiguity in different classes/files..