std::clog, std::wclog
Aus 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. |
definiert in Header <iostream> | ||
externstd::ostream clog; | (1) | |
externstd::wostream wclog; | (2) | |
Die globale Objekte std::clog und std::wclog Steuerausgang auf einen Strompuffer der Umsetzung Typs (abgeleitet von std::streambuf), mit dem Standard C Ausgabestrom stderr assoziiert, aber im Gegensatz std::cerr / std::wcerr, diese Ströme sind nicht automatisch gespült und nicht automatisch binden ( ) 'd mit 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.
Diese Objekte sind garantiert gebaut, bevor die erste Konstruktor einer statischen Objekt aufgerufen werden, und sie werden garantiert, um die letzten Destruktor eines statischen Objekts überleben, so dass es immer möglich ist, um std::clog im User-Code zu schreiben .
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.
Sofern sync_with_stdio(false) ausgestellt wurde, ist es sicher den gleichzeitigen Zugriff auf diese Objekte aus mehreren Threads sowohl für formatierte und unformatierte Ausgabe .
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.
[Bearbeiten]Beispiel
#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";}
Output:
static constructor main function static destructor
[Bearbeiten]Siehe auch
initialisiert Standard-Stream-Objekten 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. (öffentlichen Member der Klasse of std::ios_base ) | |
schreibt der Standard-C-Fehler Stream stderr, unbuffered (globales Objekt) Original: The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
schreibt in den Standard-C Ausgabe-Stream stdout (globales Objekt) |