Share via


basic_stringbuf::pbackfail

The protected virtual member function tries to put back an element into the input buffer, and then make it the current element (pointed to by the next pointer).

virtual int_type pbackfail( 
   int_type _Meta = traits_type::eof( ) 
);

Parameters

  • _Meta
    The character to insert into the buffer, or traits_type::eof.

Return Value

If the function cannot succeed, it returns traits_type::eof. Otherwise, it returns traits_type::not_eof(_Meta).

Remarks

If _Meta compares equal to traits_type::eof, the element to push back is effectively the one already in the stream before the current element. Otherwise, that element is replaced by byte = traits_type::to_char_type(_Meta). The function can put back an element in various ways:

  • If a putback position is available, and the element stored there compares equal to byte, it can decrement the next pointer for the input buffer.

  • If a putback position is available, and if the stringbuf mode permits the sequence to be altered (mode & ios_base::out is nonzero), it can store byte into the putback position and decrement the next pointer for the input buffer.

Requirements

Header: <sstream>

Namespace: std

See Also

Reference

basic_stringbuf Class

iostream Programming

iostreams Conventions