🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

auto_ptr<T> solution (?)

#2595
From: Alexandre Oliva
Date: Thu, 16 Nov 1995 16:07
28 lines
1386 bytes
What if auto_ptr<T> had one more level of indirection, that is,
instead of having

T* ptr;

had

T** ptr;

so that it could change *ptr even if the auto_ptr were const?

This new pointer should be allocated and de-allocated by the auto_ptr
class. Some care would have to be taken to assure this other pointer
would always be deleted.

Maybe the auto_ptr template could also add a new parameter to allow
the definition of a specialized allocator for those pointers.

-- 
Alexandre Oliva
oliva@dcc.unicamp.br
Departamento de Ci^encia de Computa,c~ao
Universidade Estadual de Campinas
Campinas  S~ao Paulo  Brazil

[ 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: <OLIVA.95Nov16021514@euler.dcc.unicamp.br>
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage
From: oliva@euler.dcc.unicamp.br (Alexandre Oliva)
Newsgroups: comp.std.c++
Subject: auto_ptr<T> solution (?)
Date: 16 Nov 1995 16:07:00 GMT
Organization: DCC - UNICAMP - Campinas, SP, Brazil
Approved: clamage@eng.sun.com (comp.std.c++)
Distribution: world
Message-ID: <OLIVA.95Nov16021514@euler.dcc.unicamp.br>
NNTP-Posting-Host: taumet.eng.sun.com
Content-Type: text
X-Nntp-Posting-Host: euler.dcc.unicamp.br
Content-Length: 611
X-Lines: 24
Originator: clamage@taumet