basic_ostream& flush();
If rdbuf() is not a null pointer, the function calls rdbuf()->pubsync(). If that returns -1, the function calls setstate(badbit). It returns *this.
rdbuf
()
rdbuf()->
pubsync
setstate
(badbit)
*this