
15 Jun
2012
15 Jun
'12
2:06 p.m.
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.