streambuf::pbackfail [virtual] [protected]
int pbackfail ( int c = EOF );

Put character back.
  Puts back a character into the input stream and makes it available again as the next character. If c is EOF the character push back is automatically the same character extracted in that position, otherwise parameter c is compared to the putback postion character.
  This virtual protected function is called by sputbackc when it fails, i.e. there is no put back position available in the input sequence defined by gptr and eback pointers or if the character passed is not the expected for that position.
  As a virtual function it can be overridden in derived classes in order to provide additional putback positions to be modified and to set appropriate values for gptr and egptr pointers if, for example, the external source of characters used by the streambuf-derived object indeed has such putback positions availabale. An overridden function may push back a character even it doesn't match the expected character for that puchback position.


Character value to be push back.

Return Value.
  The function shall return EOF to indicate failure in pushing back the character and any other value to indicate success.

Basic template member declaration ( basic_streambuf<charT,traits> ):
typedef traits::int_type int_type;
int_type pbackfail ( int_type c = traits::eof() );

See also.
  sputbackc, underflow
  streambuf class

© The C++ Resources Network, 2001