* 子类对父类成员的访问权限跟如何继承没有任何关系, * "子类可以访问父类的 public 和 protected 成员,不可以访问父类的 private 成员”——这句话对任何一种继承都是成立的。 * */
| 36 | * |
| 37 | */ |
| 38 | class Derived : Base { |
| 39 | public: |
| 40 | using Base::value; // error! 不能访问 private 成员 |
| 41 | void test2() { cout << "value is " << value << endl; } |
| 42 | }; |
| 43 | |
| 44 | |
| 45 | int main() |
nothing calls this directly
no outgoing calls
no test coverage detected