tmp/tmptf05j_fe/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### Class `ios_base::Init` <a id="ios.init">[[ios.init]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
class ios_base::Init {
|
| 6 |
+
public:
|
| 7 |
+
Init();
|
| 8 |
+
Init(const Init&) = default;
|
| 9 |
+
~Init();
|
| 10 |
+
Init& operator=(const Init&) = default;
|
| 11 |
+
private:
|
| 12 |
+
static int init_cnt; // exposition only
|
| 13 |
+
};
|
| 14 |
+
}
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
The class `Init` describes an object whose construction ensures the
|
| 18 |
+
construction of the eight objects declared in `<iostream>`
|
| 19 |
+
[[iostream.objects]] that associate file stream buffers with the
|
| 20 |
+
standard C streams provided for by the functions declared in `<cstdio>`.
|
| 21 |
+
|
| 22 |
+
For the sake of exposition, the maintained data is presented here as:
|
| 23 |
+
|
| 24 |
+
- `static int init_cnt`, counts the number of constructor and destructor
|
| 25 |
+
calls for class `Init`, initialized to zero.
|
| 26 |
+
|
| 27 |
+
``` cpp
|
| 28 |
+
Init();
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
*Effects:* Constructs and initializes the objects `cin`, `cout`, `cerr`,
|
| 32 |
+
`clog`, `wcin`, `wcout`, `wcerr`, and `wclog` if they have not already
|
| 33 |
+
been constructed and initialized.
|
| 34 |
+
|
| 35 |
+
``` cpp
|
| 36 |
+
~Init();
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
*Effects:* If there are no other instances of the class still in
|
| 40 |
+
existence, calls `cout.flush()`, `cerr.flush()`, `clog.flush()`,
|
| 41 |
+
`wcout.flush()`, `wcerr.flush()`, `wclog.flush()`.
|
| 42 |
+
|