streambuf::sync

Syntax

virtual int sync();

Remarks

The virtual sync function, together with the overflow and underflow functions, defines the characteristics of the streambuf-derived class. Each derived class might implement sync differently, but the interface with the calling stream class is the same.

The sync function flushes the put area. It also empites the get area and, in the process, sends any unprocessed characters back to the source, if necessary.

Default Implementation

Returns 0 if the get area is empty and there are no more characters to output; otherwise, it returns EOF.

Return Value

EOF if an error occurs.

See Also

streambuf::overflow