std::basic_streambuf::~basic_streambuf
Aus cppreference.com
< cpp | io | basic streambuf
![]() | 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_streambuf(); | ||
Diese Zerstörung ist leer: die Mitglieder dieser
basic_streambuf
(die Zeiger und die locale) werden in Übereinstimmung mit den üblichen Objekt Zerstörung Sequenz nach dieser Destruktor wieder zerstört. Da es jedoch deklariert öffentliche virtuelle, erlaubt es die Objekte, die von std::basic_streambuf
abgeleitet sind, um durch einen Zeiger auf Basisklasse löschen .Original:
This destruction is empty: the members of this
basic_streambuf
(the pointers and the locale) are destructed in accordance with the usual object destruction sequence after this destructor returns. However, since it is declared public virtual, it allows the objects that are derived from std::basic_streambuf
to be deleted through a pointer to base class.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]Parameter
(None)
Original:
(none)
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 <iostream>#include <fstream> int main(){std::filebuf* fbp = new std::filebuf; fbp->open("test.txt", std::ios_base::out); fbp->sputn("Hello\n", 6);std::streambuf* sbp = fbp; delete sbp;// the file is closed, output flushed and writtenstd::ifstream f("test.txt");std::cout<< f.rdbuf();// proof}
Output:
Hello
[Bearbeiten]Siehe auch
konstruiert eine basic_streambuf Objekt Original: constructs a basic_streambuf object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (geschützt Member-Funktion) |