[ostream.manip] (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.5 Standard basic_ostream manipulators [ostream.manip]

Each instantiation of any of the function templates specified in this subclause is a designated addressable function ([namespace.std]).

template<class charT, class traits> basic_ostream<charT, traits>& endl(basic_ostream<charT, traits>& os);

Effects: Callsos.put(os.widen('\n')), thenos.flush().

template<class charT, class traits> basic_ostream<charT, traits>& ends(basic_ostream<charT, traits>& os);

Effects: Inserts a null character into the output sequence: callsos.put(charT()).

template<class charT, class traits> basic_ostream<charT, traits>& flush(basic_ostream<charT, traits>& os);

Effects: Callsos.flush().

template<class charT, class traits> basic_ostream<charT, traits>& emit_on_flush(basic_ostream<charT, traits>& os);

Effects: If os.rdbuf() is abasic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, calls buf->set_emit_on_sync(true).

Otherwise this manipulator has no effect.

[Note 1:

To work around the issue that theAllocator template argument cannot be deduced, implementations can introduce an intermediate base class to basic_syncbuf that manages its emit-on-sync flag.

— _end note_]

template<class charT, class traits> basic_ostream<charT, traits>& noemit_on_flush(basic_ostream<charT, traits>& os);

Effects: If os.rdbuf() is abasic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, calls buf->set_emit_on_sync(false).

Otherwise this manipulator has no effect.

template<class charT, class traits> basic_ostream<charT, traits>& flush_emit(basic_ostream<charT, traits>& os);

Effects: Calls os.flush().

Then, if os.rdbuf() is abasic_syncbuf<charT, traits, Allocator>*, called buf for the purpose of exposition, behaves as an unformatted output function ([ostream.unformatted]) of os.

After constructing a sentry object, calls buf->emit().

If that call returns false, calls os.setstate(ios_base​::​badbit).