You can't have access specifiers for namespaces, but you can for classes:
class company {
// Private (default)
class MyPrivateClass { ... };
public:
class MyPublicClass { ... };
};
You access the classes just like for a namespace with the scope operator:
company::MyPublicClass my_public_object;
If the "public" class should have access to the "private" class, then the "private" class have to be a friend
of the `public" class.
There is also another way, and that is to simply not have the MyPrivateClass
definition in a public header file. Either define the class in the source file, or in a private header file only included internally.
Which way to choose depends on your design and use-cases.