basic_ios& copyfmt(const basic_ios& other);
If other refers to the same object as *this, has no effects. Otherwise, copies the state of the stream
other into *this. This is done in the following sequence:
otherto *this except for rdstate(), the exception mask, and rdbuf(). In particular, makes copies of the locale, the formatting flags, the contents of the arrays std::ios_base::iword and std::ios_base::pword (but not the
pwordpointers themselves), the callbacks, and the tied stream.
otherto *this as if by calling exceptions(other.exceptions())
|other||-||another stream to use as source|
The second pass through the callbacks may be used to deep-copy the user-defined objects pointed to by the pointers in std::ios_base::pword
copyfmt() may be used to save and restore the state of a stream. Boost provides a more fine-grained IO state savers library for the same purpose.
makes the ofstream object "out" behave exactly like std::cout, including formatting, tie() to std::cin, etc.