std::basic_ostream<CharT,Traits>::~basic_ostream
De cppreference.com
< cpp | io | basic ostream
![]() | Esta página se ha traducido por ordenador/computador/computadora de la versión en inglés de la Wiki usando Google Translate. La traducción puede contener errores y palabras aparatosas/incorrectas. Planea sobre el texto para ver la versión original. Puedes ayudar a corregir los errores y mejorar la traducción. Para instrucciones haz clic aquí. |
virtual ~basic_ostream(); | ||
Destruye el objeto
basic_ostream
. Este destructor no lleva a cabo ninguna operación en la streambuffer subyacente (rdbuf()
): los destructores de los flujos de producción derivados como std::basic_ofstream y std::basic_ostringstream son responsables de llamar a los destructores de los 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.
[editar]Ejemplo
Ejecuta este código
#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 unaffectedint main(){std::ostringstream s; s <<42; add_words(s.rdbuf()); s <<".";std::cout<< s.str()<<'\n';}
Salida:
42 is the answer.