🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #331

Re: derived classes/nonmember functions

#331
From: Jonathan P. Leech
Date: Fri, 03 Oct 1986 02:51
26 lines
1443 bytes
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
    __@/
Technical Details
Message-ID: <1007@cit-vax.Caltech.Edu>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!think!nike!cit-vax!jon
References: <66700004@uiucdcsp>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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