Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!bloom-beacon!mintaka!yale!think!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!voder!decvax!roger From: roger@decvax.UUCP (Roger H. Scott) Newsgroups: comp.lang.c++ Subject: Re: Pure Virtual Destructors Message-ID: <82@pascal.decvax.UUCP> Date: 8 Feb 90 10:31:06 GMT References: <4800082@m.cs.uiuc.edu> <4924@drutx.ATT.COM> <10382@alice.UUCP> <4982@drutx.ATT.COM> <10422@alice.UUCP> <5033@drutx.ATT.COM> Reply-To: roger@procase.UUCP (Roger H. Scott) Organization: proCASE Corporation, Santa Clara, CA Lines: 15 In article <5033@drutx.ATT.COM> kvt@drutx.ATT.COM (TranKV) writes: >Commenting on PURE VIRTUAL DESTRUCTORS >... >I might be ignorant here but to counter Andrew's comments: I think the confusion here stems from Tran's misconception that a pure virtual function "does nothing" when "called". The only thing that pure virtuals do when called is abort your program - if you want to do "nothing" write "{}" as the body of your function [this may still do more than "nothing" is the case of ctors and dtors]. It is slightly unfortunate, but less than earth-shattering, that in order to provide a virtual "basis" for destructors in a class hierarchy you have do declare and define a "pointless" destructor in a [quite possibly abstract] base class. This destructor does nothing useful and does require at least a function call to execute [unless it is inline, but inline virtuals are a BAD IDEA with AT&T's 2.0].