A virtual member function in C++ works as expected:
The dynamic type of the receiver controls which function to call.
Destructors may also be virtual, §17.2.5 (4ed).