std::basic_ostream::~basic_ostream
Da cppreference.com.
< cpp | io | basic ostream
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
| virtual ~basic_ostream(); |
||
Distrugge l'oggetto
basic_ostream. Questo distruttore non si esegue alcuna operazione sul streambuffer sottostante (rdbuf()): i distruttori dei flussi in uscita derivati come std::basic_ofstream e std::basic_ostringstream sono responsabili per chiamare i distruttori delle streambuffers.Original:
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.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.
[modifica] Esempio
#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'; }
Output:
42 is the answer.