MCPcopy Create free account
hub / github.com/EricPengShuai/Interview / Derived

Class Derived

base_code/derived_base.cpp:38–42  ·  view source on GitHub ↗

* 子类对父类成员的访问权限跟如何继承没有任何关系, * "子类可以访问父类的 public 和 protected 成员,不可以访问父类的 private 成员”——这句话对任何一种继承都是成立的。 * */

Source from the content-addressed store, hash-verified

36 *
37 */
38class Derived : Base {
39public:
40 using Base::value; // error! 不能访问 private 成员
41 void test2() { cout << "value is " << value << endl; }
42};
43
44
45int main()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected