A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../algorithm/../io/manip/unitbuf.html below:

std::unitbuf, std::nounitbuf - cppreference.com

Enables or disables automatic flushing of the output stream after any output operation. Has no effect on input.

This is an I/O manipulator, it may be called with an expression such as out << std::unitbuf for any out of type std::basic_ostream or with an expression such as in >> std::unitbuf for any in of type std::basic_istream.

[edit] Notes

Flushing is performed in the destructor of the std::basic_ostream::sentry object, which calls str.rdbuf()->pubsync() if str.flags() & std::ios_base::unitbuf is true.

The standard output objects std::cerr and std::wcerr have their unitbuf bit set by default.

[edit] Parameters str - reference to I/O stream [edit] Return value

str (reference to the stream after manipulation).

[edit] Example

Without std::unitbuf or another explicit flush, the output is the same, but does not appear in real time.

Output:

571ms ... 1146ms ... 1722ms ... 2294ms ... 2865ms ...
[edit] See also flushes the output stream
(function template) [edit] outputs '\n' and flushes the output stream
(function template) [edit]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4