2.5 KiB
[streambuf.virt.pback]
31 Input/output library [input.output]
31.6 Stream buffers [stream.buffers]
31.6.3 Class template basic_streambuf [streambuf]
31.6.3.5 Virtual functions [streambuf.virtuals]
31.6.3.5.4 Putback [streambuf.virt.pback]
int_type pbackfail(int_type c = traits::eof());
Thepending sequence is defined as forunderflow(), with the modifications that
-
Iftraits::eq_int_type(c, traits::eof()) returnstrue, then the input sequence is backed up one character before the pending sequence is determined.
-
Iftraits::eq_int_type(c, traits::eof()) returns false, then c is prepended. Whether the input sequence is backed up or modified in any other way is unspecified.
Postconditions: On return, the constraints ofgptr(),eback(), andpptr() are the same as forunderflow().
Returns: traits::eof() to indicate failure.
Failure may occur because the input sequence could not be backed up, or if for some other reason the pointers cannot be set consistent with the constraints.
pbackfail() is called only when put back has really failed.
Returns some value other thantraits::eof() to indicate success.
Default behavior: Returnstraits::eof().
Remarks: The public functions ofbasic_streambuf call this virtual function only whengptr() is null,gptr() == eback(), ortraits::eq(traits::to_char_type(c), gptr()[-1]) returnsfalse.
Other calls shall also satisfy that constraint.