protected virtual member function


streambuf* setbuf (char* s, streamsize n);
Set buffer
Influences the way in which output operations are buffered:

If both arguments are zero and no input/output operation has yet been performed on the object, the stream becomes unbuffered for output: On unbuffered streams, all output is directly written to the file (both pptr and pbase are always null pointers, forcing output operations to call overflow).

Otherwise, the buffering in the object is influenced in a way that is dependent on the library implementation.

This virtual member function overrides the inherited member streambuf::setbuf, called by member pubsetbuf to influence the internal buffer.


s, n
If both are zero, and no input/output operation has been performed by the object, the stream becomes unbuffered.
streamsize is a signed integral type.

Return Value

Returns this.

Data races

If both arguments are zero, it modifies the filebuf object (concurrent access to the same object may introduce data races).
Otherwise, unspecified.

Exception safety

Basic guarantee: if an exception is thrown, the file stream buffer is in a valid state.

See also