When static members are inherited, are they static for the entire hierarchy, or just that class, i.e.:
class SomeClass
{
public:
SomeClass(){total++;}
static int total;
};
class SomeDerivedClass: public SomeClass
{
public:
SomeDerivedClass(){total++;}
};
int main()
{
SomeClass A;
SomeClass B;
SomeDerivedClass C;
return 0;
}
would total be 3 in all three instances, or would it be 2 for SomeClass
and 1 for SomeDerivedClass
?