std::clog, std::wclog
Материал из 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. |
| Заголовочный файл <iostream>
|
||
| extern std::ostream clog; |
(1) | |
| extern std::wostream wclog; |
(2) | |
Глобальные объекты std::clog и std::wclog выход управления в поток буфера реализации определенного типа (производное от std::streambuf), связанные со стандартным stderr выходной поток C, но, в отличие от std::cerr / std::wcerr, эти потоки автоматически не покраснел и не автоматически привязать ( ) 'D с соиЬ.
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.
Эти объекты гарантированно будут построены до первого конструктора статического объекта вызывается и они гарантированно пережить последний деструктор статического объекта, так что всегда можно написать std::clog в пользовательском коде.
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.
Если sync_with_stdio(false) было выдано, что это безопасно для одновременного доступа к этим объектам из нескольких потоков для форматированных и неформатированных выход.
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.
[править] Пример
Вывод:
static constructor main function static destructor
[править] См. также
| инициализирует стандартные объекты потока 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. (public член класса std::ios_base)
| |
| пишет в стандартный поток ошибки C stderr, unbuffered
(глобальный объект) Original: writes to the standard C error stream stderr, unbuffered (глобальный объект) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
| пишет в стандартный выходной поток stdout
(глобальный объект) C Original: writes to the standard C output stream stdout (глобальный объект) The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |