protected virtual member function
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 basic_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: basic_filebuf overrides this virtual member function (see basic_filebuf::sync).
Returns zero, which indicates success.
A value of
-1 would indicate failure.
Introduces no data races, but overriden versions in derived classes may.
No-throw guarantee: this default definition never throws exceptions.