std::basic_stringbuf::swap
提供: cppreference.com
< cpp | io | basic stringbuf
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
void swap( std::basic_stringbuf& rhs ) |
(C++11およびそれ以降) | |
スワップ状態と*thisの内容と
rhs
.Original:
Swaps the state and the contents of *this and
rhs
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
目次 |
[編集] パラメータ
rhs | - | 別
basic_stringbuf Original: another basic_stringbuf The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
(なし)
Original:
(none)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] ノート
std::stringstreamオブジェクトをスワップする際に、この関数が自動的に呼び出され、それはそれを直接呼び出すことがほとんど必要ありません.
Original:
This function is called automatically when swapping std::stringstream objects, it is rarely necessary to call it directly.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[編集] 例
このコードを実行します
#include <sstream> #include <string> #include <iostream> int main() { std::istringstream one("one"); std::ostringstream two("two"); std::cout << "Before swap, one = \"" << one.str() << '"' << " two = \"" << two.str() << "\"\n"; *one.rdbuf()->swap(*two.rdbuf()); std::cout << "Before swap, one = \"" << one.str() << '"' << " two = \"" << two.str() << "\"\n"; }
出力:
Before swap, one = "one" two = "two" Before swap, one = "two" two = "one"
[編集] も参照してください
basic_stringbufオブジェクトを作成します Original: constructs a basic_stringbuf object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) | |
(C++11) |
swaps two string streams (パブリックメンバ関数of std::basic_stringstream )
|