This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: auto_ptr, new warning? (was: New STL implementation from SGI)



> A note on auto_ptr... It's an unsafe class imho.
> The problem I have with it is that when it accidently is
> used for a temporary, then the ownership is lost (with
> memory leak as result, or worse).

Are you basing your notion of what auto_ptr does on the Dec. 1996
draft (the one that is on the web) or the final draft (which you can't get
unless you are on the committee)?  The two are quite different.

> PS I wrote my own auto_ptr and use that :/.

You should call it something different then.  auto_ptr is a standard
class.  If you write a class that doesn't work the same way, it will
only confuse people.

I'm not happy with everything the committee did, but we shouldn't get into
redesigning the standard library.




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]