protected virtual member function
<streambuf> <iostream>


int sync();
Synchronize stream buffer
Virtual function called by the public member function pubsync to synchronize the contents in the buffer with those of the associated character sequence.

Its default behavior in streambuf is to do nothing and return zero (indicating success), but derived classes that use intermediate buffers shall override this behavior to properly synchronize them: filebuf overrides this virtual member function (see filebuf::sync).



Return Value

Returns zero, which indicates success.
A value of -1 would indicate failure.

Data races

Introduces no data races, but overriden versions in derived classes may.

Exception safety

No-throw guarantee: this default definition never throws exceptions.

See also