protected virtual member function


basic_filebuf* setbuf (char_type* 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 basic_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.
Member type char_type is the type of the characters in the stream buffer (the first class template parameter).
streamsize is a signed integral type.

Return Value

Returns this.

Data races

If both arguments are zero, it modifies the basic_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