Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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& _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>

Community Additions

ADD
Show:
© 2015 Microsoft