std::basic_ostream<CharT,Traits>::flush (3) - Linux Manuals
std::basic_ostream<CharT,Traits>::flush: std::basic_ostream<CharT,Traits>::flush
NAME
std::basic_ostream<CharT,Traits>::flush - std::basic_ostream<CharT,Traits>::flush
Synopsis
basic_ostream& flush();
Writes uncommitted changes to the underlying output sequence.
If rdbuf() is a null pointer, does nothing
Otherwise, behaves as an UnformattedOutputFunction (since C++11). After constructing and checking the sentry object, calls rdbuf()->pubsync(). If the call returns -1, calls setstate(badbit).
Parameters
(none)
Return value
*this
Exceptions
May throw std::ios_base::failure if exceptions()&badbit!=0.
Example
// Run this code
Output:
See also
sync (public member function of std::basic_istream<CharT,Traits>)
flush (function template)
endl (function template)