basic_streambuf::underflow

virtual int_type underflow();

The protected virtual member function endeavors to extract the current element c from the input stream, without advancing the current stream position, and return it as T::to_int_type(c). It can do so in various ways:

If the function cannot succeed, it returns T::eof(), or throws an exception. Otherwise, it returns the current element in the input stream, converted as described above. The default behavior is to return T::eof().