1.
Each class have a virtual function will maintain a V-TABLE;
V TABLE only contain virtual function!
2.
Each object,will have a pointer (store in the front of obejct members)head to the V-TABLE ahead.
3.
When derived class override the base virtual function.the derived function will replace the base class in subclass V-table!
4.For multiple inheritance
The subclass will maintain a table(2 dimension)
like:
base 1:derive :f();g();h();derive:g();
base 2:derive :f();g();h();
base 3:derive :f();g();h();
C++ Virtual Table
最新推荐文章于 2024-02-21 10:30:59 发布