🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #2100

Re: auto_ptr: :reset and auto_ptr::operator=

#2100
From: J. Kanze
Date: Tue, 03 Oct 1995 13:22
23 lines
1710 bytes
Bill Gibbons (bgibbons@taligent.com) wrote:

|> 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.

While I've certainly less experience than Taligent, this was my feeling,
too.

So how do you do it: as I do, by casting away const in the assignment
operator and the copy constructor, or do you have some other trick?  (I
would love to find a better solution, since I think that Fergus'
concerns about this solution *are* valid.)
-- 
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils en informatique industrielle--
                             --Beratung in industrieller Datenverarbeitung
---
[ 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: <44qrtl$f6a@gabi.gabi-soft.fr>
Path: arc1-ca.pugleaf.net!in1.uu.net!bounce-back
References: <199509111753.AA15077@xs1.xs4all.nl> <gregorDEtM0t.Hw2@netcom.com> <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!in1.uu.net!bounce-back
Date: 03 Oct 95 13:22:10 GMT
Approved: fjh@cs.mu.oz.au
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.std.c++
Subject: Re: auto_ptr: :reset and auto_ptr::operator=
X-Original-Date: 3 Oct 1995 09:23:17 +0100
Organization: GABI Software, Sarl.
Message-ID: <44qrtl$f6a@gabi.gabi-soft.fr>
References: <199509111753.AA15077@xs1.xs4all.nl> <gregorDEtM0t.Hw2@netcom.com> <MATT.95Sep22101332@physics11.Berkeley.EDU> <9527400.19710@mulga.cs.mu.OZ.AU> <9510022022.AA18434@mailserv.taligent.com>
X-Newsreader: TIN [version 1.2 PL2]