Boost logo

Boost :

Subject: Re: [boost] rvalue ref best practices?
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-06-15 12:02:19


on Fri Jun 15 2012, Mathias Gaunard <mathias.gaunard-AT-ens-lyon.org> wrote:

> On 15/06/2012 15:59, Sebastian Redl wrote:
>
>> Assume T is std::array<E, 32>, where E isn't movable and its copy
>> constructor/assignment might throw. std::array's assignment operator
>> gives only the basic guarantee. So if an exception occurred in the
>> assignment operator, you know that the vector is array, but you don't
>> know anything about its contents. It might be a wild mixture of what was
>> in it before the assignment and the elements returned from bar.
>
> Some operator= implementation do not provide the strong guarantee, but
> that's not the case of most objects.

Most people don't know what "most objects" are like :-)

> It doesn't seem a good idea to introduce a new function overloading
> mechanism to drop that would always void this guarantee.

I don't understand this sentence.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

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