C++ named requirements: FormattedOutputFunction
[edit] Requirements
A FormattedOutputFunction is a stream output function that performs the following:
- 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
failbitas well, and if exceptions on failbit are enabled in this output stream's exception mask, throws ios_base::failure. - flushes the tie()'d output stream, if applicable.
- if eofbit or badbit are set on the output stream, sets the
- Checks the status of the sentry by calling
sentry::operator bool(), which is equivalent to basic_ios::good. - If the sentry returned false or sentry's constructor threw an exception, no output takes place
- If the sentry returned true, attempts to perform the desired output by inserting the characters into the output stream as if by calling rdbuf()->sputc() or rdbuf()->xsputn(). Additionally, rdbuf()->overflow() and rdbuf()->sync() may be called, but no other virtual member function of std::basic_streambuf.
- If the output could not be generated, sets
failbit, If exceptions on failbit are enabled in this stream's exception mask, throws ios_base::failure. - if an exception is thrown during output, sets
badbitin the output stream. If exceptions on badbit are enabled in this stream's exception mask, the exception is also rethrown. - If no exception was thrown, returns *this.
- If the output could not be generated, sets
- In any event, whether terminating by exception or returning, the sentry's destructor is called before leaving this function.
[edit] Standard library
The following standard library functions are FormattedOutputFunctions.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
