For a class, the default protection level is private
For a struct, the default protection level is public
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class Foo
{
int x; // <- Foo is a class, so x is private
};
template <typename Z>
class Foo
{
Z x; // <- Foo is still a class, so x is private
};
struct Foo
{
int x; // <- Foo is a struct, so x is public
};