Will this work, or will there be slicing (i.e. only the memory corresponding to that occupied by a Base object will be freed, rather than for the whole Derived object):
Base* ptr = new Derived;
delete ptr;
If not, will this?
delete static_cast<Derived*>(ptr);