C++——派生类修改基类成员的访问权限
案例一: class A { int x, y; public: int getx() { return x; } protected: int gety() { return y; } }; class B : private A /* public A */ /* protected A */{ bool visible; public: using A::getx; A::gety; // deprecated }; 案例二: class MyList { struct Node { int v; Node* next; Node(int v, Node* n) { this->v = v; next = n; } ~Node() { cout << "~Node()\n"; delete next; next = nullptr; } } *head; public: MyList() { head = nullptr; } ~MyList() { if (head !...