std::clog, std::wclog
De cppreference.com
![]() | 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. |
Déclaré dans l'en-tête <iostream> | ||
externstd::ostream clog; | (1) | |
externstd::wostream wclog; | (2) | |
Les objets globaux std::clog et de sortie de commande std::wclog à une mémoire tampon de flux de type défini par l'application (extraite de std::streambuf), associée à la norme C stderr flux de sortie, mais, à la différence std::cerr / std::wcerr, ces flux sont automatiquement supprimées et ne pas lier automatiquement ( ) 'd avec cout .
Original:
The global objects std::clog and std::wclog control output to a stream buffer of implementation-defined type (derived from std::streambuf), associated with the standard C output stream stderr, but, unlike std::cerr/std::wcerr, these streams are not automatically flushed and not automatically tie()'d with cout.
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.
Ces objets sont garantis d'être construits avant le premier constructeur d'un objet statique est appelé et ils sont garantis pour survivre à la dernière destructeur d'un objet statique, de sorte qu'il est toujours possible d'écrire à std::clog dans le code utilisateur .
Original:
These objects are guaranteed to be constructed before the first constructor of a static object is called and they are guaranteed to outlive the last destructor of a static object, so that it is always possible to write to std::clog in user code.
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.
Sauf sync_with_stdio(false) a été délivré, il est sûr d'accéder simultanément à ces objets à partir de plusieurs threads à la fois pour une sortie formatée et non formaté .
Original:
Unless sync_with_stdio(false) has been issued, it is safe to concurrently access these objects from multiple threads for both formatted and unformatted output.
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.
[modifier]Exemple
#include <iostream>struct Foo {int n; Foo(){ std::clog<<"static constructor\n";} ~Foo(){ std::clog<<"static destructor\n";}}; Foo f;// static objectint main(){ std::clog<<"main function\n";}
Résultat :
static constructor main function static destructor
[modifier]Voir aussi
initialise les objets de flux standard Original: initializes standard stream objects The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (classe membre publique de std::ios_base ) | |
écrit dans le flux d'erreur standard C stderr, unbuffered ( objet global )Original: global object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. Original: writes to the standard C error stream stderr, unbuffered ( objet global )Original: global object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
écrit à la norme C stdout ( objet global ) flux de sortie Original: global object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. Original: writes to the standard C output stream stdout ( objet global )Original: global object The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |