I have a x.cpp file in which i see a class being defined inside namespace. So, my question is :
1) What is the advantage of defining a class inside the namespace? 2)Secondly, i also see structures defined out of the namespace in the same x.cpp file. So, what is the benefit of doing so in the same x.cpp file?
x.h looks like something as follows:
class x{
private:
struct abc;
};
And x.cpp looks as:
namespace{
class{};
}
struct x:abc{};