最終更新日時(UTC):
が更新

履歴 編集

function
<sstream>

std::basic_stringstream::operator=(C++11)

basic_stringstream& operator=(basic_stringstream&& rhs);           // (1) C++11
basic_stringstream& operator=(const basic_stringstream&) = delete; // (2) C++11

概要

ムーブ代入を行う。

効果

  • (1) : basic_iostream<CharT, Traits>::operator=(std::move(rhs))を呼び出し、sb = std::move(rhs.sb)を実行する。ここでsbは内部のbasic_stringbufオブジェクトである。

戻り値

*this

#include <iostream>
#include <sstream>
#include <string>

int main()
{
  std::stringstream ss1("first");
  std::stringstream ss2;

  // ムーブ代入
  ss2 = std::move(ss1);

  std::cout << ss2.str() << std::endl;
}

出力

first

バージョン

言語

  • C++11

処理系

  • Clang: 3.0 , 3.1 , 3.2 , 3.3 , 3.4 , 3.5.0 , 3.6.0 , 3.7.0 , 3.8.0
  • GCC: 5.1.0 , 5.2.0 , 6.0.0
  • ICC: ??
  • Visual C++: ??