|
In the structure of the C++ object, if there is a virtual function, there will be a virtual function table, as everyone knows, and the destructor will be placed in the second index position of the virtual function table, and the first index position is placed in type_info , Used to support RTTI. This is the case regardless of the class. The polymorphism of the destructor is different from the ordinary function, and there is only one destructor for each class, which can guarantee the calling conditions of polymorphism, and it does not use inheritance itself. Come to realize it, so you don't need to be surprised |
|