std::basic_filebuf::operator=
提供: cppreference.com
< cpp | io | basic filebuf
![]() |
このページは、Google 翻訳を使って英語版から機械翻訳されました。
翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
std::basic_filebuf& operator=( std::basic_filebuf&& rhs ); |
(C++11およびそれ以降) | |
std::basic_filebuf& operator=( const std::basic_filebuf& rhs ) = delete; |
||
最初
2) close()
は、関連付けられたファイルをクローズするために呼び出し、その後rhs
に*this
の内容を移動します入れて、バッファを取得し、関連するファイル、ロケール、OPENMODE、IS_OPENフラグ、および他の状態。移動後、rhs
は、ファイルおよびrhs.is_open() == falseに関連付けられていません.Original:
First calls
close()
to close the associated file, then moves the contents of rhs
into *this
: the put and get buffers, the associated file, the locale, the openmode, the is_open flag, and any other state. After the move, rhs
is not associated with a file and rhs.is_open() == false.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.
コピー代入演算子が削除されます。
basic_filebuf
はCopyAssignable
はないです.Original:
The copy assignment operator is deleted;
basic_filebuf
is not CopyAssignable
.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_filebuf Original: another basic_filebuf that will be moved fromThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[編集] 値を返します
*this
[編集] 例
このコードを実行します
#include <fstream> #include <string> #include <iostream> int main() { std::ifstream fin("test.in"); // read-only std::ofstream fout("test.out"); // write-only std::string s; getline(fin, s); std::cout << s << '\n'; // output *fin.rdbuf() = std::move(*fout.rdbuf()); getline(fin, s); std::cout << s << '\n'; // empty line std::cout << std::boolalpha << fout.is_open() << '\n'; // prints "false" }
[編集] も参照してください
basic_filebufオブジェクトを作成します Original: constructs a basic_filebuf 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) |
スワップ2 basic_filebufオブジェクト Original: swaps two basic_filebuf objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (パブリックメンバ関数) |