Namespaces
Variants

std:: emit_on_flush, std:: noemit_on_flush

From cppreference.net
< cpp ‎ | io ‎ | manip
Input/output manipulators
Floating-point formatting
Integer formatting
Boolean formatting
Field width and fill control
Other formatting
Whitespace processing
Output flushing
emit_on_flush noemit_on_flush
(C++20) (C++20)
Status flags manipulation
Time and money I/O
(C++11)
(C++11)
(C++11)
(C++11)
Quoted manipulator
(C++14)
定义于头文件 <ostream>
template < class CharT, class Traits >
std:: basic_ostream < CharT, Traits > & emit_on_flush ( std:: basic_ostream < CharT, Traits > & os ) ;
(1) (C++20 起)
template < class CharT, class Traits >
std:: basic_ostream < CharT, Traits > & noemit_on_flush ( std:: basic_ostream < CharT, Traits > & os ) ;
(2) (C++20 起)

如果 os. rdbuf ( ) 实际指向一个 std:: basic_syncbuf < CharT, Traits, Allocator > buf ,则切换其在刷新时是否发射(即向底层流缓冲区传输数据):

1) 调用 buf. set_emit_on_sync ( true )
2) 调用 buf. set_emit_on_sync ( false )

否则,这些操纵器不会产生任何效果。

这是一个仅输出的I/O操纵器,可通过诸如 out << std :: emit_on_flush 的表达式调用,适用于任何 out 类型为 std::basic_ostream 的输出流。


目录

参数

os - 输出流引用

返回值

os (指代经过操作后的流引用)

示例

参见

修改当前同步时发射策略
( std::basic_syncbuf<CharT,Traits,Allocator> 的公开成员函数)