void swap (basic_fstream& x);
*this.1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// swapping fstream objects
#include <fstream> // std::fstream
int main () {
std::fstream foo;
std::fstream bar ("test.txt");
foo.swap(bar);
foo << "lorem ipsum";
foo.close();
return 0;
}
*this and x).