std::basic_ostream::~basic_ostream

来自cppreference.com
< cpp‎ | io‎ | basic ostream

virtual ~basic_ostream();
销毁的basic_ostream对象。这个析构函数不执行任何操作上的的基本streambuffer(rdbuf())的析构函数派生的输出流,如std::basic_ofstreamstd::basic_ostringstream是负责调用析构函数的streambuffers.
原文:
Destroys the basic_ostream object. This destructor does not perform any operation on the underlying streambuffer (rdbuf()): the destructors of the derived output streams such as std::basic_ofstream and std::basic_ostringstream are responsible for calling the destructors of the streambuffers.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 示例

#include <sstream>
#include <iostream>
void add_words(std::streambuf* p)
{
    std::ostream buf(p); // buf shares the buffer with s
    buf << " is the answer";
} // calls the destructor of buf. p remains unaffected
int main()
{
    std::ostringstream s;
    s << 42;
    add_words(s.rdbuf());
    s << ".";
    std::cout << s.str() << '\n';
}

输出:

42 is the answer.