15.14.3 Using Stream Buffers Directly
All member functions of the class basic_istream and basic_ostream that read or write characters
operate according to the same schema: First, a corresponding sentry object is constructed, and
then the operation is performed. The construction of the sentry object results in flushing of potentially
tied objects, skipping of whitespace for input, and such implementation-specific operations as
locking in multithreaded environments (see Section 15.5.4, page 772).