Boost logo

Boost :

From: Greg Colvin (Gregory.Colvin_at_[hidden])
Date: 2003-01-28 23:19:07


At 08:25 PM 1/28/2003, Edward Diener wrote:
>"Beman Dawes" <bdawes_at_[hidden]> wrote in message
>news:4.3.2.7.2.20030128191017.0229cce8_at_mailhost.esva.net...
>> At 01:42 PM 1/28/2003, David B. Held wrote:
>>
>> >"Greg Colvin" <Gregory.Colvin_at_[hidden]> wrote in message
>> >news:5.2.0.9.2.20030128104737.027bcea8_at_rgmgitmail.oraclecorp.com...
>>
>> >> Also, auto_ptr is an ugly hack that needn't be replicated.
>> >
>> >Disavowing your child? ;)
>>
>> Historical note: auto_ptr<> was one of the few (maybe only) times when the
>> C++ committee as a whole overrode the recommendation of the Library
>Working
>> Group.
>>
>> Greg and other people in the LWG didn't like auto_ptr<>, preferring what is
>> now called shared_ptr<>. But we were good soldiers, and accepted the
>> committee's decision. That meant we had to develop auto_ptr<>, even though
>> we didn't like it. A lot of us still think it is a minor smart pointer, and
>> has no place in the standard, except perhaps as an adjunct to more
>> important smart pointers such as shared_ptr<> and eventually smart_ptr<>.
>
>Many people have used std::auto_ptr<> successfully to do what it does best.
>As languages and understanding evolve other, better solutions have evolved
>also, but that doesn't mean std::auto_ptr<> has not served its purpose or
>will continue to do so.

My problem with auto_ptr isn't so much the semantics, which
have proved useful and are probably the minimum needed to
solve the problem that the committee wanted solved. And it
isn't so much the "move as copy" syntax that Howard dislikes.
And except on a personal level it isn't the politics that led
to it being the way it is. My problem is the extremely fragile
language tricks needed to implement auto_ptr, exploiting a
loophole on a loophole, which I don't think should be imitated
unless really, really necessary. I hope that in the next
standard the language can be changed in a way that makes
auto_ptr straightforward to implement.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk