◐ Shell
clean mode source ↗

std::basic_ostream::sentry — cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Déclaré dans l'en-tête

<ostream>

template< class CharT, class Traits = std::char_traits<CharT> > class std::basic_istream<charT,traits>::sentry

Un objet de classe basic_ostream::sentry est réalisé sous rayonnement local au début de chaque fonction membre de std::basic_ostream qui effectue de sortie (à la fois formatées ou non). Son constructeur prépare le flux de sortie: vérifie si le flux est déjà en état d'échec, bouffées de la cravate () 'flux de sortie d, et effectue d'autres tâches définies par l'application si nécessaire. Définie par l'implémentation de nettoyage, ainsi que le rinçage du flux de sortie, si nécessaire, est effectuée dans le destructeur, de sorte qu'il est garanti de se produire si des exceptions sont levées lors de la sortie .

Original:

An object of class basic_ostream::sentry is constructed in local scope at the beginning of each member function of std::basic_ostream that performs output (both formatted and unformatted). Its constructor prepares the output stream: checks if the stream is already in a failed state, flushes the tie()'d output streams, and performs other implementation-defined tasks if necessary. Implementation-defined cleanup, as well as flushing of the output stream if necessary, is performed in the destructor, so that it is guaranteed to happen if exceptions are thrown during output.

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

Fonctions membres

construit la sentinelle object.
All les tâches de préparation ont fait ici

Original:

constructs the sentry object.
All the preparation tasks are done here

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


(fonction membre publique) [edit]

finalise l'objet de flux après une sortie formatée ou après exception, le cas échéant

Original:

finalizes the stream object after formatted output or after exception, if necessary

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


(fonction membre publique)

operator=

l'opérateur d'affectation est supprimé

Original:

the assignment operator is deleted

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


(fonction membre publique)

vérifie si la préparation de l'objet de flux a été un succès

Original:

checks if the preparation of the stream object was successful

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


(fonction membre publique) [edit]

Exemple

Voir aussi

inserts en forme des données

Original:

inserts formatted data

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


(fonction membre publique) [edit]