Path: utzoo!attcan!uunet!snorkelwacker!tut.cis.ohio-state.edu!att!drutx!kvt From: kvt@drutx.ATT.COM (TranKV) Newsgroups: comp.lang.c++ Subject: Re: True Virtual Message-ID: <5034@drutx.ATT.COM> Date: 6 Feb 90 22:56:08 GMT References: <4800082@m.cs.uiuc.edu> <4924@drutx.ATT.COM> <10382@alice.UUCP> <4982@drutx.ATT.COM> <10424@alice.UUCP> Reply-To: kvt@drutx.ATT.COM (TranKV) Organization: AT&T, Denver, CO Lines: 30 In article <10424@alice.UUCP> shopiro@alice.UUCP (Jonathan Shopiro) writes: >Kim Tran wants to know why he can't have a pure virtual destructor, >that is > > class Foo { > virtual ~Foo() = 0; // error > }; > >The reason is that whenever an object is destroyed, the destructors >for all its base classes are executed. The pure virtual syntax says ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >that the function will never be called, but its name is a legitimate ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >function name so the compiler tries to call it in the destructor of ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >the derived class. ^^^^^^^^^^^^^^^^^^ Do we have a case of "double dealings" here? |-) or a symptom of wanting to do a lot behind the scene for the users but ending up lying to them? Well, for one thing, it reminds me of the Iran/Contra trials that are making headlines here. |-) (I just cannot help making the comparision. Just for fun. No offense intended.) Kim Tran Bell Labs kvt@drutx.att.com