C++相談室 part137at TECH
C++相談室 part137 - 暇つぶし2ch812:デフォルトの名無しさん
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.



次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch