Article View: comp.std.c++
Article #2431Re: Virtual calls on unfinished objects (was:
From: Fergus Henderson
Date: Mon, 06 Nov 1995 00:11
Date: Mon, 06 Nov 1995 00:11
41 lines
2147 bytes
2147 bytes
clamage@Eng.Sun.COM (Steve Clamage) writes: >The current object model has these features: >1. Calls to virtual functions from ctors/dtors are well-defined. >2. Construction/destruction of base classes is fully automatic. >3. During construction/destruction, you always know the validity of the > object; that is, the order of construction and destruction of members > and bases is predefined. >4. When deriving a class, you need to know only the public and protected > interface of base classes; you don't need to know any implementation > details. I disagree. The current object model doesn't have feature 4. When deriving a class, you need to know the contract that each virtual function which you override must satisfy. >It seems to me that in order to allow calls to derived virtual overrides >from a base-class ctor/dtor you have to give up some of these features. I disagree. The only feature you need to give up is feature 4, but since you never had that anyway, you haven't really lost anything. >If you are going to >change the object model significantly, you might as well think about other >major changes and make a new language, IMHO. On this I agree. I don't think the C++ object model is optimal, but I agree it would be a very bad idea to change it now. -- Fergus Henderson WWW: http://www.cs.mu.oz.au/~fjh fjh@cs.mu.oz.au PGP: finger fjh@128.250.37.3 -- --- [ 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:
<9530923.7794@mulga.cs.mu.OZ.AU>Path:
arc1-ca.pugleaf.net!tcsi.tcs.com!agate!agate!MattReferences:
<VANDEVOD.95Oct30130647@avs.cs.rpi.edu> <475jnr$1sv@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!tcsi.tcs.com!agate!agate!Matt From: fjh@cs.mu.OZ.AU (Fergus Henderson) Newsgroups: comp.std.c++ Subject: Re: Virtual calls on unfinished objects (was: Date: 06 Nov 1995 00:11:30 GMT Organization: Computer Science, University of Melbourne, Australia Approved: Matt@Austern Message-ID: <9530923.7794@mulga.cs.mu.OZ.AU> References: <VANDEVOD.95Oct30130647@avs.cs.rpi.edu> <475jnr$1sv@engnews1.eng.sun.com> NNTP-Posting-Host: austern.hip.berkeley.edu