streambuf::sync

virtual int sync();

Return Value

EOF if an error occurs.

Remarks

The virtual sync function, 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 empties 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.

streambuf OverviewStream Buffer Classes

See Also   streambuf::overflow