|Re: YACC error handling firstname.lastname@example.org (1989-07-29)|
|yacc error handling email@example.com (Ajay Kalhan) (1999-11-19)|
|Re: yacc error handling firstname.lastname@example.org (Ajay Kalhan) (1999-11-21)|
|Re: yacc error handling email@example.com (Bryan Ewbank) (1999-11-23)|
|Re: yacc error handling firstname.lastname@example.org (Zalman Stern) (1999-11-28)|
|Re: yacc error handling email@example.com (Michael C Schweisguth) (1999-12-07)|
|Re: yacc error handling firstname.lastname@example.org (Bill Fahle) (1999-12-24)|
|From:||"Bill Fahle" <email@example.com>|
|Date:||24 Dec 1999 00:31:42 -0500|
Ajay Kalhan <firstname.lastname@example.org> wrote
> (I can see I am extending the original question here)
> What if besides memory I wanted to invoke destructors of created objects?
What I would do is keep a list of allocated objects, all of which
descend from a common base class (make the list a list of that base
class). Give that base class a virtual destructor, and then just call
delete on each object in the list when finished. Of course this
assumes that no object frees another object, since they will be freed
later in the list (or might have already been freed earlier). You
might also look into garbage collection (e.g., reference counting w/
smart pointers) as a way to manage memory.
Return to the
Search the comp.compilers archives again.