You can define a class in an unnamed namespace, for example,
namespace
{
struct A {};
}
In this case, the class name will have an internal binding. That is, this is visible only in the compilation unit where it is defined, and all compilation units that include this definition will have their own class definitions.
As for the storage class specifier static, (7.1.1 Storage class specifiers )
5 The static specifier can only be applied to variable and function names and anonymous unions.
source
share