🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Alexandre Oliva Thu, 16 Nov 1995 16:07
auto_ptr<T> solution (?)
#2595
Author: 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. ]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads