
29 Apr
2010
29 Apr
'10
8:01 p.m.
Ion GaztaƱaga wrote:
On 29/04/2010 20:00, Jeffrey Hellrung wrote:
I'm confused. So static_cast< Arg&& >(r) creates a new temporary object (rather than just a (rvalue) reference to the r object) when used in direct construction, but does not behave this way otherwise (e.g., the line after "//Correct binding" above?
Yes, it's something strange, but I think this seems a compiler bug. This makes some porting to MSVC-10.0 a bit harder. One option is to store all the addresses in pointers and cast them back somehow without bitting this bug.
To reiterate: is it possible to just use a lvalue reference for the member variable? - Jeff