다음을 통해 공유


basic_istream::sentry

The nested class describes an object whose declaration structures the formatted and unformatted input functions.

class sentry {
public:
    explicit sentry(
        basic_istream<Elem, Tr>& _Istr,
        bool _Noskip = false
    );
    operator bool( ) const;
};

설명

If _Istr.good is true, the constructor:

  • Calls _Istr.tie -> flush if _Istr.tie is not a null pointer

  • Effectively calls ws(_Istr) if _Istr.flags & skipws is nonzero

If, after any such preparation, _Istr.good is false, the constructor calls _Istr.setstate(failbit). In any case, the constructor stores the value returned by _Istr.good in status. A later call to operator bool delivers this stored value.

요구 사항

Header: <istream>

네임스페이스: std

참고 항목

참조

basic_istream 클래스

iostream 프로그래밍

iostreams 규칙