C++ named requirements: UnformattedOutputFunction
From cppreference.com
[edit] Requirements
A UnformattedOutputFunction is a stream output function that performs the following:
1) Constructs an object of type basic_ostream::sentry with automatic storage duration, which performs the following:
- If eofbit or badbit are set on the output stream, sets the failbit as well, and if exceptions on
failbit
are enabled in this output stream's exception mask ((exceptions() & failbit) != 0), throws ios_base::failure. - Flushes the tie()'d output stream, if applicable.
2) Checks the status of the sentry by calling
sentry::operator bool()
, which is equivalent to basic_ios::good.
- If the operator returns false or sentry's constructor throws an exception, no output takes place.
- If the operator returns true, attempts to perform the desired output by inserting the characters into the output stream as if by calling rdbuf()->sputc(). Other public members of std::basic_ostream may also be used, but virtual members of rdbuf() except overflow(), xsputn() and sync() will never be called.
- If an exception is thrown during output, sets
badbit
in the output stream. If exceptions onbadbit
are enabled in this stream's exception mask ((exceptions() & badbit) != 0), the exception is also rethrown. - If no exception was thrown, returns the value specified by the function.
- If an exception is thrown during output, sets
3) In any event, whether terminating by exception or returning, the sentry's destructor is called before leaving this function.