Boost logo

Boost :

Subject: Re: [boost] rvalue ref best practices?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-06-15 10:06:08


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.

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


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