Reputation: 345
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:
Upvotes: 0
Views: 96
Reputation: 249153
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.
Upvotes: 1