Article View: comp.std.c++
Article #2038Re: Inheritance and references to pointers
From: Andrew Koenig
Date: Tue, 26 Sep 1995 06:53
Date: Tue, 26 Sep 1995 06:53
23 lines
1432 bytes
1432 bytes
In article <445k3k$18p@isoit109.bbn.hp.com> Jean-Rene Bouvier <jr@isoit109.bbn.hp.com> writes: > 2. what is the reason for this restriction, or rather, is there any reason to > keep this restriction (apart from the fact that a DerviedObject*& bears no > inheritance relationship to an Object*&) ? The real problem is that a DerivedObject* might not have the same internal representation (i.e. bit pattern) as an Object*, because there is no reason to believe that the Object part of a DerivedObject is at the beginning of the DerivedObject. In the presence of multiple inheritance, we can guarantee that a DerivedObject* will have a different representation from a pointer to at least one of its base classes. -- --Andrew Koenig ark@research.att.com --- [ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu. Contact address: std-c++-request@ncar.ucar.edu. The moderation policy is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<MATT.95Sep25225331@Austern>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattReferences:
<445k3k$18p@isoit109.bbn.hp.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: ark@research.att.com (Andrew Koenig) Newsgroups: comp.std.c++ Subject: Re: Inheritance and references to pointers Date: 26 Sep 1995 06:53:31 GMT Organization: AT&T Bell Laboratories, Murray Hill NJ Approved: Matt@Austern Message-ID: <MATT.95Sep25225331@Austern> References: <445k3k$18p@isoit109.bbn.hp.com> NNTP-Posting-Host: austern.hip.berkeley.edu