◐ Shell
clean mode source ↗

std::basic_streambuf::~basic_streambuf — cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

virtual ~basic_streambuf();

Cette destruction est vide: les membres de cette basic_streambuf (les pointeurs et de la localisation) sont détruites conformément à la séquence d'habitude après la destruction d'objet retourné par cette destructeur. Cependant, comme il est déclaré public virtuel, il permet aux objets qui sont issus de std::basic_streambuf être supprimés via un pointeur vers la classe de base .

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.

Paramètres

(Aucun)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Exemple

#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 written
    std::ifstream f("test.txt");
    std::cout << f.rdbuf(); // proof
}

Résultat :

Voir aussi

construit un objet basic_streambuf

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.


(fonction membre protégée) [edit]