Article View: comp.std.c++
Article #2391Re: Why allow virtual function calls in co
From: Gregory Bond
Date: Thu, 02 Nov 1995 02:30
Date: Thu, 02 Nov 1995 02:30
31 lines
1881 bytes
1881 bytes
In article <472ujv$ns0@engnews1.eng.sun.com> clamage@Eng.Sun.COM (Steve Clamage) writes:
>Right now, I think it makes sense disallowing them.
The problem is actually a little more subtle. You also have to disallow
passing the value of "this" out of a constructor or destructor, or
make the results of doing so undefined.
... which would invalidate the common idiom:
class A {
Destroy();
Copy(const A&);
public:
~A() { Destroy(); }
A(const A& a) { Copy(a); }
operator=(const A& a) { Destroy(); Copy(a); }
}
... and hence is probably unacceptable.
Greg.
--
Gregory Bond <gnb@bby.com.au> Burdett Buckeridge & Young Ltd Melbourne Australia
``Efforts to maintain the "purity" of a language only succeed in establishing an
elite class of people who know the shibboleths. Ordinary folks know better,
even if they don't know what "shibboleth" means.'' - Larry Wall
[ 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:
<GNB.95Nov2115554@dame.bby.com.au>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<VANDEVOD.95Oct29144834@avs.cs.rpi.edu> <472ujv$ns0@engnews1.eng.sun.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: gnb@bby.com.au (Gregory Bond) Newsgroups: comp.std.c++ Subject: Re: Why allow virtual function calls in co Date: 2 Nov 1995 02:30:14 GMT Organization: Burdett, Buckeridge & Young Ltd., Melbourne, Australia Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <GNB.95Nov2115554@dame.bby.com.au> References: <VANDEVOD.95Oct29144834@avs.cs.rpi.edu> <472ujv$ns0@engnews1.eng.sun.com> NNTP-Posting-Host: taumet.eng.sun.com Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Nntp-Posting-Host: dame.bby.com.au In-Reply-To: clamage@Eng.Sun.COM's message of 30 Oct 1995 17:53:08 GMT Content-Length: 895 Originator: clamage@taumet