Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!uunet!sbi!pivot-sts!swampthing!wfl From: wfl@swampthing.sbi.com (W. Linke CPE) Newsgroups: comp.lang.c++ Subject: Re: Pure virtual destructors are illegal? Summary: pure virtual destructors are different from pure virtual member funcs Keywords: virtual destructor Message-ID: <185@swampthing.sbi.com> Date: 3 Jun 91 21:58:09 GMT References: <183@swampthing.sbi.com> <1991Jun1.192610.18321@borland.com> Organization: Salomon Brothers - NJ Lines: 25 In article <1991Jun1.192610.18321@borland.com>, pete@borland.com (Pete Becker) writes: > "Pure virtual" does not mean "no implementation"! It only means that > a derived class must override the pure virtual function. In the case of a > pure virtual destructor, since it will be called by the destructor for the > derived class, you must provide an implementation. Thanks for the correction. After reading this, I studied the ARM some more. and I think I understand. It's not a bug, but there is something a little ungainly about pure virtual destructors, because their nature differs from ordinary pure virtual member functions, as follows: A pure virtual member function *MAY* be defined for the abstract class in which it is declared, but it *MUST* be overridden in some class derived from the abstract class in order to create class objects, but a pure virtual destructor *MUST* be defined for the abstract class in which it is declared, while it *MAY* be "overridden" in classes derived from the abstract class. It's not inconsistent; just not as generalized as it seemed. "Pure virtual" in the above really means two different (overlapping) things. (The overlap is that they both cause their declaration class to be abstract.) Bill Linke uunet!sbi!gort!wfl