rvalue references in libstdc++
Howard Hinnant
hhinnant@apple.com
Mon Apr 30 21:53:00 GMT 2007
On Apr 30, 2007, at 5:18 PM, Peter Dimov wrote:
> Howard Hinnant wrote:
>
>> When faced with this same challenge in the CodeWarrior library I had
>> good luck with the technique outlined here:
>>
>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/
>> n1771.html#old_move
>
> I was going to suggest the same thing... but why the second
> overload of move? There is no use case where the argument is an
> rvalue, right?
I believe it was just me being conservative. I.e. move(rvalue) is
legal in C++0X, so I was just covering my behind. ;-) And actually
move(const l/rvalue) is legal too in C++0X (though not very
fulfilling). I don't think I actually ever used it. But if client
code did, then it would at least compile as it would in C++0X.
-Howard
More information about the Libstdc++
mailing list