basic_ios::copyfmt
Copies flags from one stream to another.
basic_ios<Elem, Traits>& copyfmt(
const basic_ios<Elem, Traits>& _Right
);
매개 변수
- _Right
The stream whose flags you want to copy.
반환 값
The this object for the stream to which you are copying the flags.
설명
The member function reports the callback event erase_event. It then copies from _Right into *this the fill character, the tie pointer, and the formatting information. Before altering the exception mask, it reports the callback event copyfmt_event. If, after the copy is complete, state & exceptions is nonzero, the function effectively calls clear with the argument rdstate. It returns *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
요구 사항
Header: <ios>
네임스페이스: std