Article View: comp.std.c++
Article #3251Re: auto_ptr again
From: James Kanze US/ESC 60/3/141 #407...
Date: Tue, 06 Feb 1996 02:31
Date: Tue, 06 Feb 1996 02:31
36 lines
2412 bytes
2412 bytes
In article <4eucnc$hr9@hermes.synopsys.com> jbuck@Synopsys.COM (Joe
Buck) writes:
|> "john (j.d.) hickin" <hickin@bnr.ca> writes:
|> >And this, the expectation that constructors of the form X(X&) and
|> >X(const X&) must perform a *copy* operation, is, IMHO, the trouble.
|> No, the notion that these constructors perform copy operations (and only
|> copy operations) is deeply wired in to the language, in at least three
|> places: argument passing, return value passing, and optimizing away of
|> copy constructors all assume these constructors mean "copy".
|> >The original term was reference constructor, a name which, in my opinion,
|> >carefully stepped around all subtleties of language.
|> I have never seen this term used. Stroustrup said "copy constructor"
|> at a very early stage.
|> Anyone who writes a class in which X(X&) or X(const X&) does not have the
|> semantics of a copy operation is doing something wrong (e.g. auto_ptr in
|> the draft standard is broken).
I wouldn't go quite that far. X(X&) is a particular form of copy,
which modifies the copied object. If it is programmed in such a way
that the number of intermittent copies is meaningless (as is the case
in auto_ptr), then it is perfectly valid.
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils, itudes et rialisations en logiciel orienti objet --
-- A la recherche d'une activiti dans une region francophone
---
[ 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:
<9602051159.AA19131@lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!in2.uu.net!bounce-backReferences:
<4ebhn5$lgt@bmtlh10.bnr.ca> <4eucnc$hr9@hermes.synopsys.com>Show Full Headers
Complete Article Headers
From: James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> Message-ID: <9602051159.AA19131@lts.sel.alcatel.de> X-Original-Date: Mon, 5 Feb 96 12:59:40 +0100 Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back Date: 06 Feb 96 02:31:20 GMT Approved: fjh@cs.mu.oz.au Organization: - In-Reply-To: jbuck@Synopsys.COM's message of 03 Feb 96 06:46:42 GMT Newsgroups: comp.std.c++ Subject: Re: auto_ptr again References: <4ebhn5$lgt@bmtlh10.bnr.ca> <4eucnc$hr9@hermes.synopsys.com> X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUBMRa9ouEDnX0m9pzZAQH4JgF+O8A2iKUTDdaTrmlUhKmd91B7ZkES305P MZIrDd+qE8gKd3guaSvmXRLefzw96qdK =hL0e