The function std::move()
is defined as
template<typename T>
typename std::remove_reference<T>::type&& move(T && t)
{
return static_cast<typename std::remove_reference<T>::type&&>( t );
}
There are four places where I can imagine the move constructor to be called:
- When the parameter is passed.
- When the cast is performed.
- When the result is returned.
- Not in the
std::move()
function itself but possibly at the place where the returned reference ultimately arrives.
I would bet for number 4, but I'm not 100% sure, so please explain your answer.