February 18, 2020
move, even more simply
std::move doesn’t move.
It casts to an rvalue-reference, which is a type of reference that can be passed to a move constructor or assignment operator, if one exists.
template <typename T> decltype(auto) move(T&& a) { return static_cast<std::remove_reference_t<T>&&>(a); } Some expressions will be converted to rvalue-references automatically, when the compiler is certain that the value is expiring (will not be reused).
This is the case for temporaries or non-reference objects returned from functions.
Read more