[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]

Re: "delete", "destroy", "reclaim", and "p->Heaper::~Heaper();"

> From: vlad!mark (Mark S. Miller)
> "destroy()" (like all messages/member function invocations) is a
> request.  "delete" is a command--C++ doesn't allow it to be refused.
> Voluntarism should be one of the guiding principles of object oriented
> programming.

The latter is not true.

The semantics of BLASTing out of a destructor:  The object has not been
destroyed, but remains as an instance of the class whose destructor
exited by BLASTing.

The object may have become one of its superclasses, or its type may
be unchanged, depending on which of the stack of destructors BLASTed.

If the BLAST is caught, the object's clients have the option of correcting
the environment or (by calling member functions) the object's state, and
continuing the destruction by again executing "delete <object>".  They
also have the option of continuing to use the object that refused

(Has all of this "delete" stuff happened because I didn't make that
 clear in the documentation?)