Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!bionet!ames!sun-barr!rutgers!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: cant use virtuals in base constructors Message-ID: <9327@alice.UUCP> Date: 8 May 89 22:23:25 GMT References: <198@riunite.ACA.MCC.COM> Distribution: comp Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 29 In article <198@riunite.ACA.MCC.COM>, rfg@riunite.ACA.MCC.COM (Ron Guilmette) writes: -> One question. You said that "f must be supplanted" in all derived classes. -> Supplanted how? Will this be legal? (I hope so!) -> class base { -> public: -> virtual void f() = 0; -> }; -> class middle : public base { -> public: -> virtual void f() = 0; // force leaves to supplant f() -> }; -> class derived : public middle { -> public: -> virtual void f() {} // finally! -> }; Yes. In this particular example, the semantics will not change if you omit the definition of middle::f(). You can also omit `virtual' in middle::f and derived::f. -- --Andrew Koenig ark@europa.att.com