Boost logo

Boost :

Subject: Re: [boost] [ptr_container] Questionable strong guarantee of ptr_map::insert()
From: Nevin \ (nevin_at_[hidden])
Date: 2009-08-24 18:34:34


2009/8/24 Thorsten Ottosen <thorsten.ottosen_at_[hidden]>

> I want to hear about some compatibility policy in Boost to guess the
>> possibility of this kind of breaking (but otherwise good) changes.
>>
>
> Well, you also break perfectly valid and safe code where the auto pointer
> is returned from a function.

While it is a breaking change, it is a compile-time breaking change with a
very easy fix for the caller (they pass FunctionReturningAutoPtr().release()
instead of FunctionReturningAutoPtr()). And it isn't like the library
hasn't had breaking changes before (the iterators had changed). Currently,
the semantics are surprising (they certainly are to me); I believe that most
people expect that if they pass an auto_ptr and an exception is thrown, then
the auto_ptr has not relinquished ownership. Otherwise, why bother with an
auto_ptr at all?

-- 
Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404
Sent from Chicago, Illinois, United States

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