27 Input/output library [input.output]

27.7 Formatting and manipulators [iostream.format]

27.7.3 Output streams [output.streams]

27.7.3.6 Formatted output functions [ostream.formatted]

27.7.3.6.3 basic_ostream::operator<< [ostream.inserters]

basic_ostream<charT,traits>& operator<< (basic_ostream<charT,traits>& (*pf)(basic_ostream<charT,traits>&))

Effects: None. Does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).

Returns: pf(*this).328

basic_ostream<charT,traits>& operator<< (basic_ios<charT,traits>& (*pf)(basic_ios<charT,traits>&))

Effects: Calls pf(*this). This inserter does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).

Returns: *this.329

basic_ostream<charT,traits>& operator<< (ios_base& (*pf)(ios_base&))

Effects: Calls pf(*this). This inserter does not behave as a formatted output function (as described in [ostream.formatted.reqmts]).

Returns: *this.

basic_ostream<charT,traits>& operator<< (basic_streambuf<charT,traits>* sb);

Effects: Behaves as an unformatted output function (as described in [ostream.unformatted], paragraph 1). After the sentry object is constructed, if sb is null calls setstate(badbit) (which may throw ios_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 calls setstate(failbit) (which may throw ios_base::failure ([iostate.flags])). If an exception was thrown while extracting a character, the function sets failbit in error state, and if failbit is on in exceptions() the caught exception is rethrown.

Returns: *this.

See, for example, the function signature endl(basic_ostream&) ([ostream.manip]).

See, for example, the function signature dec(ios_base&) ([basefield.manip]).