C++ streambuf - pbackfail



Description

It is used to put character back and moves back the get pointer (gptr) one position to point to the previous character and, if the basic_stringbuf object was constructed with ios_base::out, it stores c at that position.

Declaration

Following is the declaration for std::basic_stringbuf::pbackfail.

int_type pbackfail (int_type c = traits_type::eof());

Parameters

cCharacter to be put back.

Return Value

It returns traits_type::not_eof(c) on success or the end-of-file value on failure.

Exceptions

Basic guarantee − if an exception is thrown, the object is in a valid state.

Data races

It modifies the basic_stringbuf object.

streambuf.htm
Advertisements