std::basic_istream::~basic_istream
Aus cppreference.com
< cpp | io | basic istream
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
virtual ~basic_istream(); | ||
Zerstört sich die Input-Stream .
Original:
Destructs the input stream.
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.
[Bearbeiten]Notes
Dieser Destruktor führt keine Operation auf dem zugrunde liegenden streambuffer (
rdbuf()
): die Destruktoren der abgeleiteten Input-Streams, wie std::basic_ifstream und std::basic_istringstream sind verantwortlich für den Aufruf der Destruktoren der streambuffers .Original:
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.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.
[Bearbeiten]Beispiel
#include <sstream>#include <iostream> void print_stringbuf(std::streambuf* p){std::istream buf(p);// buf shares the buffer with s1int 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';}
Output:
10,20