[ostream.inserters] (original) (raw)
31 Input/output library [input.output]
31.7 Formatting and manipulators [iostream.format]
31.7.6 Output streams [output.streams]
31.7.6.3 Formatted output functions [ostream.formatted]
31.7.6.3.3 basic_ostream::operator<< [ostream.inserters]
basic_ostream& operator<<(basic_ostream& (*pf)(basic_ostream&));
basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
After the sentry object is constructed, ifsb is null callssetstate(badbit)(which may throwios_base::failure).
Gets characters from sband inserts them in*this.
Characters are read from sband inserted until any of the following occurs:
- end-of-file occurs on the input sequence;
- inserting in the output sequence fails (in which case the character to be inserted is not extracted);
- an exception occurs while getting a character from sb.
If the function inserts no characters, it callssetstate(failbit)(which may throwios_base::failure ([iostate.flags])).
If an exception was thrown while extracting a character, the function setsfailbitin the error state, and iffailbitis set inexceptions()the caught exception is rethrown.
basic_ostream& operator<<(nullptr_t);
Effects: Equivalent to:return *this << s;where s is animplementation-definedNTCTS.