std::basic_streambuf::~basic_streambuf
提供: cppreference.com
< cpp | io | basic streambuf
![]() | このページは、Google 翻訳を使って英語版から機械翻訳されました。 翻訳には誤りや奇妙な言い回しがあるかもしれません。文章の上にポインタをおくと、元の文章が見れます。誤りを修正して翻訳を改善する手助けをしてください。翻訳についての説明は、ここをクリックしてください。 |
virtual ~basic_streambuf(); | ||
この破壊は空になります。この
basic_streambuf
(ポインタとロケール)のメンバーは、このデストラクタが返された後に通常のオブジェクトの破壊シーケンスに従って破棄されています。しかし、それはパブリック仮想宣言されているので、それが基底クラスへのポインタを介して削除するstd::basic_streambuf
から派生しているオブジェクトを可能に.Original:
This destruction is empty: the members of this
basic_streambuf
(the pointers and the locale) are destructed in accordance with the usual object destruction sequence after this destructor returns. However, since it is declared public virtual, it allows the objects that are derived from std::basic_streambuf
to be deleted through a pointer to base class.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 <iostream>#include <fstream> int main(){std::filebuf* fbp = new std::filebuf; fbp->open("test.txt", std::ios_base::out); fbp->sputn("Hello\n", 6);std::streambuf* sbp = fbp; delete sbp;// the file is closed, output flushed and writtenstd::ifstream f("test.txt");std::cout<< f.rdbuf();// proof}
出力:
Hello
[編集]参照
basic_streambufオブジェクトを作成します Original: constructs a basic_streambuf object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (protectedメンバー関数) |