Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!pp!riunite!rfg From: rfg@riunite.ACA.MCC.COM (Ron Guilmette) Newsgroups: comp.lang.c++ Subject: Re: Functions not defined in base class Message-ID: <194@riunite.ACA.MCC.COM> Date: 3 May 89 23:47:42 GMT References: <897@servax0.ESSEX.AC.UK> Reply-To: rfg@riunite.UUCP (Ron Guilmette) Organization: MCC Austin, Texas Lines: 27 In article <897@servax0.ESSEX.AC.UK> goss@ese.essex.ac.uk writes: { and I paraphrase ... } {Given that I have a pointer to an object, and given that the object is itself (at least) of some particular base class, I would like to...} >... be able to call a member function of {the actual derived class type of the object} >that is not defined for {the obvious static base class type of the object}, should I > >---OPTION 1 ---- > >(1) Define an empty function with the same name as for the sub-class > in the base-class's declaration. ... >Or > >(2) should I do some sort of casting operation? I would also like an answer to this question. What is stylistically preferable? Is there a consensus on which of these alternatives is better? -- // Ron Guilmette - MCC - Experimental Systems Kit Project // 3500 West Balcones Center Drive, Austin, TX 78759 - (512)338-3740 // ARPA: rfg@mcc.com // UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg