The manipulator only has meaning for buffered streams, in which case it effectively calls the pubsync member of the streambuf object (rdbuf()->pubsync()) associated to the stream.
Standard output streams also have a member function with the same name and behavior (see ostream::flush).
- Output stream on which the insertion is performed.
Because this function is designed as a manipulator, it can be used directly with no arguments in conjunction with the insertion operator (<<) on output streams (see example).
Return ValueThe same stream object on which the operation was performed (parameter os).
When this code is executed the content of the file test.txt is updated 100 times.
Basic template declaration
|endl||Insert newline and flush (manipulator function)|
|ostream::flush||Flush output stream buffer (public member function)|