从一个流复制的标记到另一个。
basic_ios<Elem, Traits>& copyfmt(
const basic_ios<Elem, Traits>& _Right
);
参数
- _Right
要复制的标记流。
返回值
所复制标记流的 this 对象。
备注
成员函数报告 erase_event 回调的事件。 它从 _Right 然后复制到 *this 填充字符、关系指针和格式设置信息。 在之前,它报告 copyfmt_event 蒙板修改异常回调的事件。 如果,在复制完成后,异常状态 & 是非零,有效函数使用参数调用 rdstate的 清除。 它将返回 *this。
示例
// basic_ios_copyfmt.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>
int main( )
{
using namespace std;
ofstream x( "test.txt" );
int i = 10;
x << showpos;
cout << i << endl;
cout.copyfmt( x );
cout << i << endl;
}
Output
10
+10
要求
页眉: <ios>
命名空间: std