Assuming that you mean you have pointer of type Base*
(which does not have a virtual destructor), pointing to object of type Derived
, and you want to delete that.
A simple way to handle this situation is to use a smart pointer such as std::shared_ptr
that remembers the original (statically known) object type and applies it for deletion.
More generally, don't use explicit delete
: leave that to smart pointers and container objects.