🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

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

#1992
From: Tony Davis
Date: Mon, 18 Sep 1995 20:16
20 lines
1155 bytes
In article <gregorDEtM0t.Hw2@netcom.com> gregor@netcom.com (Greg Colvin) writes:
> >*a = 10;  // Set a to 10.
> >b = a;    // Set b also to a (10), but deletes a in the process ?
> 
> No, the int pointed to by a is not deleted, but is now owned by b, and
> *a == 0, that is, a owns nothing.

Just to clarify, you are saying that the standard will say that
auto_ptr<T>::reset() does NOlete its pointee, correct?


Tony Davis
ted@cs.brown.edu


---
[ 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: <MATT.95Sep18131639@physics2.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
References: <199509111753.AA15077@xs1.xs4all.nl> <gregorDEtM0t.Hw2@netcom.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!128.32.155.1!matt
From: ted@cs.brown.edu (Tony Davis)
Newsgroups: comp.std.c++
Subject: Re: auto_ptr::reset and auto_ptr::operator=
Date: 18 Sep 1995 20:16:39 GMT
Organization: Brown University Department of Computer Science
Approved: matt@physics2.Berkeley.EDU (Matt Austern)
Message-ID: <MATT.95Sep18131639@physics2.Berkeley.EDU>
References: <199509111753.AA15077@xs1.xs4all.nl> <gregorDEtM0t.Hw2@netcom.com>
NNTP-Posting-Host: physics2.berkeley.edu