Initialize standard stream objects
The construction of the member object Init ensures that the standard iostream objects (cin, cout, cerr, clog, and their wide counterparts wcin, wcout, wcerr, wclog) are constructed and initialized.
The class maintains an internal static counter (as a private member) with the number of existing objects.
1 2 3 4 5
|
class ios_base::Init {
public:
Init();
~Init();
}
|
Members
- Init(); (constructor)
- Increases the internal static counter by one. If the value of the internal counter was zero, the standard iostream objects are constructed and initialized.
- ~Init(); (destructor)
- Decreases the internal static counter by one. If the value of the internal counter reaches zero, the respective flush member functions of the output standard objects are called so that their buffers are flushed.
|