Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!borland.com!pete From: pete@borland.com (Pete Becker) Newsgroups: comp.lang.c++ Subject: Re: Pure virtual destructors are illegal? Keywords: virtual destructor Message-ID: <1991Jun1.192610.18321@borland.com> Date: 1 Jun 91 19:26:10 GMT References: <183@swampthing.sbi.com> Organization: Borland International Lines: 16 In article <183@swampthing.sbi.com> wfl@swampthing.sbi.com (W. Linke CPE) writes: > >It seems that you can't have a pure virtual destructor, but the compiler >(Sun SPARCstation cfront 2.00.02) doesn't object. Consider the following: > > class Base { > public: > Base() { } > virtual ~Base() = 0; // bad! > }; "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. -- Pete