Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bloom-beacon!bu-cs!att!ulysses!andante!alice!ark From: ark@alice.UUCP (Andrew Koenig) Newsgroups: comp.lang.c++ Subject: Re: abstract class constructor pitfall Message-ID: <9543@alice.UUCP> Date: 29 Jun 89 05:02:06 GMT References: Distribution: comp Organization: AT&T Bell Laboratories, Liberty Corner NJ Lines: 16 In article , dove@rocket.UUCP (Webster Dove) writes: > The constructor a::a() is booby trapped. Since the virtual mechanism > does not work during construction, the attempted call to foo() is > undefined. class a { public: virtual void foo() = 0; a() { foo(); } }; C++ 2.0 is kind enough to give an error message here. -- --Andrew Koenig ark@europa.att.com