ostream& operator =( ostream& ros );
ostream& operator =( streambuf* sbp );
The first overloaded assignment operator assigns the specified ostream object to this ostream_withassign object.
The second operator attaches a streambuf object to an existing ostream_withassign object, and it initializes the state of the ostream_withassign object. This operator is often used in conjunction with the void-argument constructor.
filebuf fb( "test.dat" ); // Filebuf object attached to "test.dat"
cout = &fb; // fb associated with cout
cout << "testing"; // Message goes to "test.dat" instead of stdout
ostream_withassign::ostream_withassign, cout