N
Noah Roberts
I'm trying to understand the degredation principles behind references
and rvalue vs. lvalue, etc... As such I decided to implement my own
std::move() following this implementation:
http://blogs.msdn.com/vcblog/archive/2009/02/03/rvalue-references-c-0x-
features-in-vc10-part-2.aspx
Doesn't work. Apparently VC2010 RC implements the changes specified in
N2812:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2812.html#the-
problem
The issue I'm having here is that upon playing with this definition I
find that using the cast alone seems to work and I haven't been able to
find a way to break it:
template < typename T >
T&& my_move(T&& t)
{
return static_cast<T&&>(t);
}
My question then is why is it implemented in the standard in a more
complex manner using remove_reference<T>? I assume there's a very good
and important reason, so how do I break my_move?
and rvalue vs. lvalue, etc... As such I decided to implement my own
std::move() following this implementation:
http://blogs.msdn.com/vcblog/archive/2009/02/03/rvalue-references-c-0x-
features-in-vc10-part-2.aspx
Doesn't work. Apparently VC2010 RC implements the changes specified in
N2812:
http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2812.html#the-
problem
The issue I'm having here is that upon playing with this definition I
find that using the cast alone seems to work and I haven't been able to
find a way to break it:
template < typename T >
T&& my_move(T&& t)
{
return static_cast<T&&>(t);
}
My question then is why is it implemented in the standard in a more
complex manner using remove_reference<T>? I assume there's a very good
and important reason, so how do I break my_move?