Is it possible to have a virtual delete
operator? I'm not talking destructor, I mean the actual operator overload.
Minus the fact that it is (in most cases) a big bad idea to overload new
and delete
(Yes, I already know it's heresy), I want to know what kind of implications come from using a virtual delete
operator.
I'm thinking about trying to use a virtual delete, as sometimes I might have a child class that overloads delete
, stored in a base class pointer. Technically, I don't really ever see this case coming to too much fruition, unless I have a tree of different node types (potentially dangerous idea in the first place if you ask me).
I just want to know what would be the potential pros and cons of a virtual, or non-virtual, delete
operator override.