std::basic_istream::sentry
std::basic_istream::sentry
class sentry; |
An object of class basic_istream::sentry
is constructed in local scope at the beginning of each member function of std::basic_istream
that performs input (both formatted and unformatted). Its constructor prepares the input stream: checks if the stream is already in a failed state, flushes the tie()'d output streams, skips leading whitespace unless noskipws
flag is set, and performs other implementation-defined tasks if necessary. All cleanup, if necessary, is performed in the destructor, so that it is guaranteed to happen if exceptions are thrown during input.