4.9 KiB
[ostream.inserters]
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&));
Effects: None.
Does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).
basic_ostream& operator<<(basic_ios<charT, traits>& (*pf)(basic_ios<charT, traits>&));
Effects: Callspf(*this).
This inserter does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).
basic_ostream& operator<<(ios_base& (*pf)(ios_base&));
Effects: Callspf(*this).
This inserter does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).
Returns: *this.
basic_ostream& operator<<(basic_streambuf<charT, traits>* sb);
Effects: Behaves as an unformatted output function ([ostream.unformatted]).
After the sentry object is constructed, ifsb is null callssetstate(badbit) (which may throwios_base::failure).
Gets characters from sb and inserts them in*this.
Characters are read from sb and 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 setsfailbit in the error state, and iffailbit is set inexceptions() the caught exception is rethrown.
Returns: *this.
basic_ostream& operator<<(nullptr_t);
Effects: Equivalent to:return *this << s; where s is animplementation-definedNTCTS.
See, for example, the function signatureendl(basic_ostream&) ([ostream.manip]).
See, for example, the function signaturedec(ios_base&) ([basefield.manip]).