std::basic_istream::~basic_istream

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

virtual ~basic_istream();
自毁的输入流.
原文:
Destructs the input stream.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 注释

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

[编辑] 示例

#include <sstream>
#include <iostream>
 
void print_stringbuf(std::streambuf* p)
{
    std::istream buf(p); // buf shares the buffer with s1
    int n;
    buf >> n;
    std::cout << n;
} // calls the destructor of buf. p remains unaffected
 
int main()
{
    std::istringstream s1("10 20");
    print_stringbuf(s1.rdbuf());
    int n;
    s1 >> n;
    std::cout << ',' << n << '\n';
}

输出:

10,20