Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!ut-emx!walt.cc.utexas.edu!jamshid From: jamshid@walt.cc.utexas.edu (Jamshid Afshar) Newsgroups: comp.lang.c++ Subject: Re: problem with virtual function Summary: static virtual functions, please Keywords: C++, virtual Message-ID: <36531@ut-emx.UUCP> Date: 21 Aug 90 00:22:46 GMT References: <9008201757.AA23899@sirius.risc.com> Sender: news@ut-emx.UUCP Reply-To: jamshid@walt.cc.utexas.edu (Jamshid Afshar) Distribution: usa Organization: The University of Texas at Austin, Austin, Texas Lines: 16 I, too, encountered the problem of not being able to use virtual functions in a base class constructor. The only way I know around this is to either pass the information in the parameter list, or put the stuff which uses the virt.func. in a init() member function. I'm glad this came up because I posted an article to comp.std.c++ about this and have yet to receive any feedback. In the article I asked if it were possible to implement static virtual functions in C++. I have found the need for them several times. Passing stuff down a class hierarchy is a pain and it makes it hard to use inheritance when you want to change some parameter to a base class constructor farther down the line. I wrote out a scenario where I really needed them in the comp.std.c++ article, so please check it out. --Jamshid Afshar --jamshid@ccwf.cc.utexas.edu