This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [v3] Fix move assignment operators vs self assignment
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Bo Persson <bop at gmb dot dk>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Sat, 09 Jan 2010 11:30:37 +0100
- Subject: Re: [v3] Fix move assignment operators vs self assignment
- References: <4B47EF88.80607@oracle.com> <7A933FC7F13E4C0A9CB51E73226DD3BF@bettan>
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 ;)