首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::basic_streambuf::sync

int pubsync();

(1)

?

protected: virtual int sync();

(2)

?

将受控字符序列%28缓冲器%29与相关字符序列同步。

1%29次电话sync()最派生的类。

2%29此函数的基类版本没有任何影响。派生类可以覆盖此函数以允许基础设备与缓冲区同步。

对于输出流,这通常导致将PUT区域的内容写入关联序列,即输出缓冲区的刷新。对于输入流,这通常会清空GET区域,并强制从关联序列中重新读取以获取最近的更改。默认行为%28找到,例如,在std::basic_stringbuf%29,是什么都不做。

参数

%280%29

返回值

1%29sync()...

2%29?0?在成功的时候,-1否则。基类版本返回?0?...

另见

sync

synchronizes with the underlying storage device (public member function of std::basic_istream)

sync virtual

writes characters to the associated file from the put area (virtual protected member function of std::basic_filebuf)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com