[comp.lang.c++] Heapness {was: testing 'this'}

rpk@rice-chex.ai.mit.edu (Robert Krajewski) (10/16/90)

Actually, I've needed to know something more specific, and thus the
question is more manageable: can this object be >delete<ed later ?
(This is need to implement a facility where objects can be deleted/
destructed if something abnormal happens during their use, inside a
context with a short lifetime.)

The way this is done: I need a table for the objects I'm managing
anyway, so I overload new in the base class of object that live in the
table to enter the object in the table.  The base class constructor
runs after new, so I know that new ran if the constructor already
finds the object in the table.

Now, this assumes that the constructor is run after the corresponding
class to that operator new (but note that I used a table, so it
doesn't have to be immediately after), which I guess is a pretty
reasonable assumption.

----
Robert P. Krajewski
Internet: rpk@ai.mit.edu ; Lotus: robert_krajewski.lotus@crd.dnet.lotus.com