Article View: comp.std.c++
Article #2101Re: auto_ptr: :reset and auto_ptr::operator=
From: Dag Bruck
Date: Tue, 03 Oct 1995 14:46
Date: Tue, 03 Oct 1995 14:46
33 lines
2179 bytes
2179 bytes
Bill Gibbons <bgibbons@taligent.com> wrote: > > * The raw pointer must *always* be owned by some auto_ptr. > > * The raw pointer must *never* be owned by more than one auto_ptr. >..... >Taligent has had years of experience using a variety of templates which >are variants of auto_ptr. The consensus here is that auto_ptr must have >ownership semantics, and they must be enforced by the assignment operator >and copy constructor. The requirements for exception-safe programs are very important, and I agree that auto_ptr should have ownership semantics. However, it does not follow that these semantics should be implemented with the assignment operator and the copy-constructor. Because of the confusion, op= and the copy-ctor should be unimplemented (private) and the transfer of ownership implemented with some other function. (This is also one of the Swedish Committee Draft Ballot comments.) Dag Bruck -- Dynasim AB Phone: +46 46 182500 Research Park Ideon Fax: +46 46 129879 S-223 70 Lund E-mail: Dag@Dynasim.se Sweden URL: http://www.dynasim.se [ 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:
<DFv3F0.DCr@akropolis.malmo.trab.se>Path:
arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamageReferences:
<199509111753.AA15077@xs1.xs4all.nl> <MATT.95Sep22101332@physics11.Berkeley.EDU> <9527400.19710@mulga.cs.mu.OZ.AU> <9510022022.AA18434@mailserv.taligent.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!taumet!clamage From: dag@net.dynasim.se (Dag Bruck) Newsgroups: comp.std.c++ Subject: Re: auto_ptr: :reset and auto_ptr::operator= Date: 3 Oct 1995 14:46:40 GMT Organization: Dynasim AB, Lund, Sweden Sender: news@akropolis.malmo.trab.se (News adm) Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <DFv3F0.DCr@akropolis.malmo.trab.se> References: <199509111753.AA15077@xs1.xs4all.nl> <MATT.95Sep22101332@physics11.Berkeley.EDU> <9527400.19710@mulga.cs.mu.OZ.AU> <9510022022.AA18434@mailserv.taligent.com> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text X-Nntp-Posting-Host: net.dynasim.se Apparently-To: comp-std-c++@moderators.uu.net Content-Length: 1171 X-Lines: 29 Originator: clamage@taumet