basic_streambuf::underflow

To show an underflow condition and not increment the get pointer.

virtual int_type underflow();

Remarks

The function underflow() is called when a character is not available for sgetc().

There are many constraints for underflow().

The pending sequence of characters is a concatenation of end pointer minus the get pointer plus some sequence of characters to be read from input.

The result character if the sequence is not empty, the first character in the sequence or the next character in the sequence.

The backup sequence if the beginning pointer is null, the sequence is empty, otherwise the sequence is the get pointer minus the beginning pointer.

Returns the first character of the pending sequence and does not increment the get pointer. If the position is null returns traits::eof() to indicate failure.