protected virtual member function
<sstream>

std::basic_stringbuf::overflow

int_type overflow (int_type c = traits_type::eof());
Put character
Writes c to the current position of the put pointer (pptr), and advances that pointer one position forward.

If there are no positions available and the basic_stringbuf object was constructed with ios_base::out, the function first attempts to make more write positions available, reallocating the internal buffer if necessary: this may modify the pointers to both the input and output controlled sequences (up to all six of eback, gptr, egptr, pbase, pptr, epptr).

The function may also reallocate the buffer to make it larger on any call to this function, even if there are still write positions available (although it is not required to).

If c is the end-of-file value (traits_type::eof()), no characters are written and the put pointer (pptr) is not advanced, but the function may still reallocate as described above (although it is not required to).

This virtual function is called by public member functions such as sputc to put a character when there are no writing positions available at the put pointer (pptr).

Parameters

c
Character to write.
If this is the end-of-file value (traits_type::eof()), no characters are written and the put pointer (pptr) is not advanced, but other effects may apply.
Member type int_type is an integral type able to represent any character value or the special end-of-file value.

Return Value

In case of success, a value other than the end-of-file value (traits_type::eof()) is returned: If character c was successfully written, c is returned.
Otherwise, it returns the end-of-file value (traits_type::eof()) to signal failure.
Member type int_type is an integral type able to represent any character value or the special end-of-file value.

Data races

Modifies the basic_stringbuf object.
Concurrent access to the same object may cause data races.

Exception safety

Basic guarantee: if an exception is thrown, the object is in a valid state.

See also