27 Input/output library [input.output]

27.10 Synchronized output streams [syncstream]

27.10.2 Class template basic_­syncbuf [syncstream.syncbuf] Overridden virtual functions [syncstream.syncbuf.virtuals]

int sync() override;
Effects: Records that the wrapped stream buffer is to be flushed.
Then, if emit_­on_­sync is true, calls emit().
If emit_­on_­sync is false, the actual flush is delayed until a call to emit().
end note
Returns: If emit() was called and returned false, returns -1; otherwise 0.