virtual table pointer changing between constructor and destructor

In vtable-based implementations, this behavior is implemented by changing the vtable pointer between constructors/destructors at various points during initialization. The base class constructor sets the vtable to point at the base class vtable. When the derived class constructor starts, it sets the vtable to point to the derived class vtable. When the derived class destructor starts, it will set the vtable to point to the base class vtable.

你可能感兴趣的:(c++)