I know that when assign the derived object to base object, the slicing happens. The first part of derived class object will copied to the base object. And here is my quesition:
No, no vtable pointer is copied. Nor could it be, since the destination object is truly of base class type both before and after the assignment.
Virtual methods called on a sliced object will invoke the base class implementations.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.