O'Reilly logo
  • LI WEI thinks this is interesting:

This means that all code will know that Cat is an object of Mammal, and it will be possible to point to a Cat* instance using a base class Mammal* pointer. For example, the following code will be valid:

From

Cover of Learning C++ by Creating Games with UE4

Note

使用公有继承父类,父类指针可以指向子类。但私有继承不行。事实上私有继承用的不多,可以忽略。