다음을 통해 공유


basic_filebuf::pbackfail

Tries to put back an element into the input stream, then make it the current element (pointed to by the next pointer).

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

매개 변수

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

반환 값

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

설명

The protected virtual member function puts back an element into the input buffer and then makes it the current element (pointed to by the next pointer). If _Meta == 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 ch = 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 ch, it can decrement the next pointer for the input buffer.

  • If the function can make a putback position available, it can do so, set the next pointer to point at that position, and store ch in that position.

  • If the function can push back an element onto the input stream, it can do so, such as by calling ungetc for an element of type char*.*

요구 사항

Header: <fstream>

네임스페이스: std

참고 항목

참조

basic_filebuf 클래스

iostream 프로그래밍

iostreams 규칙