首先,Vee - Table指针用于访问虚函数,而对数据成员的访问直接使用编译时偏移量实现。
First, the Vee-Table pointer is used to access virtual functions, and data members are accessed directly using compile time offsets.
虚函数是实现动态多态性的方法。
Virtual Function is the method to realize dynamic polymorphism.
在基类中可以通过将虚函数声明为纯虚函数的手段来定义抽象类,强制派生类在自己的类定义中实现虚函数的具体功能。
In a base class, abstract class is defined by declaring pure virtual function, a derived class must define all inherited pure virtual functions of its base classes to be concrete.
应用推荐