This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: auto_ptr, new warning? (was: New STL implementation from SGI)
- To: carlo at runaway dot xs4all dot nl (Carlo Wood)
- Subject: Re: auto_ptr, new warning? (was: New STL implementation from SGI)
- From: Joe Buck <jbuck at synopsys dot com>
- Date: Tue, 7 Jul 98 13:03:48 PDT
- Cc: egcs at cygnus dot com
> 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.