Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!cs.dal.ca!aucs!880716a From: 880716a@aucs.uucp (Dave Astels) Newsgroups: comp.lang.c++ Subject: destructors with MI Message-ID: <1990Jun6.133126.4526@aucs.uucp> Date: 6 Jun 90 13:31:26 GMT Organization: Acadia University - School of Computer Science Lines: 46 I have a class dag as follows: class ConsCell { ConsCell *next; // ... } class List { ConsCell * head, *tail; public: ~List () ... // ... } class String { ~String () ... // ... } class ListCell : public ConsCell, public List { // ... } class StringCell : public ConsCell, public String { // ... } A List consists of a linked list of ConCells, pointed to by List::head, List::tail is simple for makeing appending (a very much used operation) more effient. The ConsCells in this list are either ListCells or StringCells. Everything works fine except for destructing. When a ListCell or StringCell gets destructed I want the List/String destructor to be called. ListCells & StringCells (and any future kinds of Cells) are deleted from the List object containing them, thus they are seen as ConsCells. My question is: how do I get them to destruct as Lists/Strings when they are deleted as ConsCells ???? -- - Dave Astels Internet: 880716a@AcadiaU.CA Bitnet: 880716a@Acadia