18/09/28 10:40:42.82 hWUH9Sli0.net
>>793
でも、以下の std::move() の実装の説明だとあなたの言ってる方が正しい気がする。
URLリンク(stackoverflow.com)
URLリンク(www.open-std.org)
The move function really does very little work. All move does is accept
either an lvalue or rvalue argument, and return it as an rvalue
without triggering a copy construction:
template <class T>
typename remove_reference<T>::type &&move(T &&a)
{
return a;
}
It is now up to client code to overload key functions on whether
their argument is an lvalue or rvalue (e.g. copy constructor and
assignment operator). When the argument is an lvalue,
the argument must be copied from.
When it is an rvalue, it can safely be moved from.