[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 801- 901- 1001- 2ch.scのread.cgiへ]
Update time : 02/24 15:41 / Filesize : 321 KB / Number-of Response : 1024
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

C++相談室 part137



812 名前:デフォルトの名無しさん mailto:sage [2018/09/28(金) 10:40:42.82 ID:hWUH9Sli0.net]
>>793
でも、以下の std::move() の実装の説明だとあなたの言ってる方が正しい気がする。

https://stackoverflow.com/questions/36206764/understanding-the-code-for-stdmove
www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2027.html#Move_Semantics

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.







[ 続きを読む ] / [ 携帯版 ]

全部読む 前100 次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧](;´∀`)<321KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef