🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#2278
From: Fergus Henderson
Date: Sun, 22 Oct 1995 07:03
28 lines
1599 bytes
kanze@gabi-soft.fr (J. Kanze) writes:

>Actually, it occurs to me that the following does work:
>
>    auto_ptr< T >       f() ;
>    auto_ptr< T >       p1( f().release() ) ;
>	auto_ptr< T >		p2 ;
>	p2.reset( f().release() ) ;
>
>Somehow, it just doesn't seem natural, though. 

It seems fine to me.

It certainly seems more natural than assignment operators that
clobber the right-hand operand.

-- 
Fergus Henderson             |  "Australia is the richest country in the world,
fjh@cs.mu.oz.au              |   according to a new system of measuring wealth
http://www.cs.mu.oz.au/~fjh  |   announced by the World Bank yesterday."
PGP: finger fjh@128.250.37.3 |  - Melbourne newspaper "The Age", 18 Sept 1995.


---
[ 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: <9529510.24230@mulga.cs.mu.OZ.AU>
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
References: <199509111753.AA15077@xs1.xs4all.nl> <MATT.95Sep22101332@physics11.Berkeley.EDU> <9527400.19710@mulga.cs.mu.OZ.AU> <9510022022.AA18434@mailserv.taligent.com> <DFv3F0.DCr@akropolis.malmo.trab.se> <44thrj$kid@gabi.gabi-soft.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt
From: fjh@munta.cs.mu.OZ.AU (Fergus Henderson)
Newsgroups: comp.std.c++
Subject: Re: auto_ptr: : reset and auto_ptr::operator=
Date: 22 Oct 1995 07:03:18 GMT
Organization: Computer Science, University of Melbourne, Australia
Approved: Matt@Austern
Message-ID: <9529510.24230@mulga.cs.mu.OZ.AU>
References: <199509111753.AA15077@xs1.xs4all.nl> <MATT.95Sep22101332@physics11.Berkeley.EDU> <9527400.19710@mulga.cs.mu.OZ.AU> <9510022022.AA18434@mailserv.taligent.com> <DFv3F0.DCr@akropolis.malmo.trab.se> <44thrj$kid@gabi.gabi-soft.fr>
NNTP-Posting-Host: austern.hip.berkeley.edu