Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!lpi.liant.com!pkt From: pkt@lpi.liant.com (Scott Turner) Newsgroups: comp.lang.c++ Subject: Re: Virtual functions used in constructor illegal ! ?? Keywords: virtual functions, constructor Message-ID: <1990Dec7.222320.26790@lpi.liant.com> Date: 7 Dec 90 22:23:20 GMT References: <822@orthogo.UUCP> <39733@ucbvax.BERKELEY.EDU> <27556AD1.350C@tct.uucp> Organization: Language Processors Inc., Framingham MA Lines: 17 In article <27556AD1.350C@tct.uucp> chip@tct.uucp (Chip Salzenberg) writes: >This is true, but only if you are calling the virtual function from >the actual constructor function body. If you call a virtual function >from a constructor by other means, such as calling a function that >calls the virtual function, E&S says that the behavior is undefined, >i.e. all bets are off. Actually, p. 294 of E&S says that virtual functions can be called from constructors "directly or indirectly". What Chip may have in mind is that a call to a _pure_ virtual function from a constructor is in general undefined. -- Prescott K. Turner, Jr. Language Processors, Inc. 959 Concord St., Framingham, MA 01701 USA (508) 626-0006 UUCP: uunet!lpi!pkt Internet: pkt@lpi.liant.com