static不能被继承,不能为虚函数 .
如果要让子类的friend函数访问父类的全部变量 :让父类声明这个函数为friend函数.
1. 父类的static变量和函数在派生类中依然可用,但是受访问性控制(比如,父类的private域中的就不可访问),而且对static变量来说,派生类和父类中的static变量是共用空间的,这点在利用static变量进行引用计数的时候要特别注意。
2. static函数没有“虚函数”一说。因为static函数实际上是“加上了访问控制的类的全局函数”,全局函数哪来的什么虚函数?
3. 派生类的friend函数可以访问派生类本身的一切变量,包括从父类继承下来的protected域中的变量。但是对父类来说,他并不是friend的。