I have read a few (pesudo) implementions of std::move(). And all are just casting away the reference of the parameter and then returning it as a rvalue reference.
It do
Yes, std::move
is a bit of a misnomer as it doesn't actually move anything. It is used to indicate that an object may be "moved from".
It does this by casting the object to a T&&
. cppreference states the return value is static_cast
. (btw, that is exactly what VS2017 does)
I don't know precisely what the standard says on the matter.