protected virtual member function
Synchronizes the intermediate buffers with the associated file:
If an intermediate output buffer exists (as defined by pptr, epptr and pback), its contents are written to the file (as if filebuf::overflow was called).
If an intermediate input buffer exists, the effects -if any- depend on the library implementation.
This virtual member function overrides the inherited member streambuf::sync, called by member pubsync to synchronize the buffers.
If successful, it returns zero.
Otherwise, it returns
-1 to indicate failure.
Modifies the filebuf object.
Concurrent access to the same file stream buffer object may introduce data races.
Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.