Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!caip!think!nike!cit-vax!jon From: jon@cit-vax.Caltech.Edu (Jonathan P. Leech) Newsgroups: net.lang.c++ Subject: Re: derived classes/nonmember functions Message-ID: <1007@cit-vax.Caltech.Edu> Date: Thu, 2-Oct-86 22:51:36 EDT Article-I.D.: cit-vax.1007 Posted: Thu Oct 2 22:51:36 1986 Date-Received: Sat, 4-Oct-86 08:33:59 EDT References: <66700004@uiucdcsp> Reply-To: jon@cit-vax.UUCP (Jonathan P. Leech) Organization: California Institute of Technology Lines: 20 Summary: Expires: Sender: Followup-To: Distribution: Organization : California Institute of Technology Keywords: In article <66700004@uiucdcsp> gaulke@uiucdcsp.cs.uiuc.edu writes: > >I am having a problem with nonmember functions and derived classes. >Specifically, if I define a nonmember function taking a base class as >an argument, then C++ (version 1.0) does not allow me to call the same >function with a derived class as an argument. The following example >illustrates the situation: > ... There is at least one good reason this won't work: a derived class may be larger than its base class. The compiler will calculate the wrong frame offsets for any other function parameters and possibly for the class argument as well. -- Jon Leech (jon@csvax.caltech.edu || ...seismo!cit-vax!jon) Caltech Computer Science Graphics Group __@/