[v3] Fix move assignment operators vs self assignment

Paolo Carlini paolo.carlini@oracle.com
Sat Jan 9 10:30:00 GMT 2010


On 01/09/2010 11:14 AM, Bo Persson wrote:
> I believe this might not be a serious oversight at all, but rather an
> early implementation of the resolution to Library Issue #1204.
>
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#1204
>
> where it says:
>
> "Additionally this clarifies that move assignment operators need not
> perform the traditional if (this != &rhs) test commonly found (and
> needed) in copy assignment operators."
Gosh, thanks Bo. Something in my head was telling me that I had read
before something about that but couldn't really remember and then found
a very simple testcase which evidently didn't behave like move
assignment operators of library containers should, in general (Table 91)
(also, forward_list and the new experimental string were doing the check)

So, I guess, I will revert the thing, fix forward_list and __vstring,
and add a HUGE comment mentioning DR 1204.


Thanks,
Paolo (some work wasted yesterday but much less ashamed ;)



More information about the Libstdc++ mailing list