This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Exploit move semantics in std::accumulate.


On 2011-01-08 20:44, Christopher Jefferson wrote:
> On 8 Jan 2011, at 18:31, Marc Glisse wrote:
>> On Sat, 8 Jan 2011, Christopher Jefferson wrote:
>>
>>> Your patch is a really nice idea. I'm not 100% sure it is allowed by the C++0x standard (although, I can't imagine any valid code which would possibly break it).
>>
>> It has a strong smell of x=move(x); about it...
> 
> I'm not too worried about that (although perhaps I should).

I'm not too worried about it either, because the latest draft standard
(n3225) seems to indicate (in Table 38) that for a type to be considered
MoveAssignable, self-move-assignment should Just Work; the
post-condition specified for the "t = rv" expression makes no exception
for self-move-assignment.

> My worry is that the standard explicitally says it uses " acc = acc + x " and " acc = binary_op(acc, x) ".

This /does/ seem like a legitimate worry to me, that I indeed had not
considered. :(  Do I understand correctly that you've already brought
this issue up on the committee's secret mailing list? I'm afraid I can't
look myself because I don't have access to these secret mailing lists..


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]