Files
2025-10-25 03:02:53 +03:00

4.4 KiB
Raw Permalink Blame History

[ostream.manip]

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]

1

#

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);

2

#

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

3

#

Returns: os.

🔗

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

4

#

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

5

#

Returns: os.

🔗

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

6

#

Effects: Callsos.flush().

7

#

Returns: os.

🔗

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

8

#

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]

9

#

Returns: os.

🔗

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

10

#

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.

11

#

Returns: os.

🔗

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

12

#

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).

13

#

Returns: os.