protected virtual member function


int_type underflow();
Get character
Returns the character at the current get pointer position (gptr), if one is available. Otherwise it returns the end-of-file value (traits_type::eof()).

This virtual function is called by public member functions of basic_streambuf such as sgetc to request a new character when there are no read positions available at the get pointer (gptr). Because basic_stringbuf objects cannot make more read characters available, the function always returns the end-of-file value in these cases.



Return Value

If a character is available at the get pointer position (gptr), that character, converted to a value of type int_type using traits_type::to_int_type.
Otherwise, the function returns the end-of-file value (traits_type::eof()).
Member type int_type is an integral type able to represent any character value or the special end-of-file value.

Data races

Accesses 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