From Jason Turner

[ios.types]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpsl_c5j04/{from.md → to.md} +17 -7
tmp/tmpsl_c5j04/{from.md → to.md} RENAMED
@@ -10,22 +10,32 @@ namespace std {
10
  explicit failure(const char* msg, const error_code& ec = io_errc::stream);
11
  };
12
  }
13
  ```
14
 
 
 
 
 
 
 
 
 
15
  The class `failure` defines the base class for the types of all objects
16
  thrown as exceptions, by functions in the iostreams library, to report
17
  errors detected during stream buffer operations.
18
 
19
  When throwing `ios_base::failure` exceptions, implementations should
20
  provide values of `ec` that identify the specific reason for the
21
- failure. Errors arising from the operating system would typically be
 
 
22
  reported as `system_category()` errors with an error value of the error
23
  number reported by the operating system. Errors arising from within the
24
  stream library would typically be reported as
25
  `error_code(io_errc::stream,
26
- iostream_category())`.
27
 
28
  ``` cpp
29
  explicit failure(const string& msg, const error_code& ec = io_errc::stream);
30
  ```
31
 
@@ -40,11 +50,11 @@ explicit failure(const char* msg, const error_code& ec = io_errc::stream);
40
  base class with `msg` and `ec`.
41
 
42
  ##### Type `ios_base::fmtflags` <a id="ios::fmtflags">[[ios::fmtflags]]</a>
43
 
44
  ``` cpp
45
- typedef T1 fmtflags;
46
  ```
47
 
48
  The type `fmtflags` is a bitmask type ([[bitmask.types]]). Setting its
49
  elements has the effects indicated in
50
  Table  [[tab:iostreams.fmtflags.effects]].
@@ -83,11 +93,11 @@ Table  [[tab:iostreams.fmtflags.constants]].
83
 
84
 
85
  ##### Type `ios_base::iostate` <a id="ios::iostate">[[ios::iostate]]</a>
86
 
87
  ``` cpp
88
- typedef T2 iostate;
89
  ```
90
 
91
  The type `iostate` is a bitmask type ([[bitmask.types]]) that contains
92
  the elements indicated in Table  [[tab:iostreams.iostate.effects]].
93
 
@@ -105,11 +115,11 @@ Type `iostate` also defines the constant:
105
  - `goodbit`, the value zero.
106
 
107
  ##### Type `ios_base::openmode` <a id="ios::openmode">[[ios::openmode]]</a>
108
 
109
  ``` cpp
110
- typedef T3 openmode;
111
  ```
112
 
113
  The type `openmode` is a bitmask type ([[bitmask.types]]). It contains
114
  the elements indicated in Table  [[tab:iostreams.openmode.effects]].
115
 
@@ -126,11 +136,11 @@ the elements indicated in Table  [[tab:iostreams.openmode.effects]].
126
 
127
 
128
  ##### Type `ios_base::seekdir` <a id="ios::seekdir">[[ios::seekdir]]</a>
129
 
130
  ``` cpp
131
- typedef T4 seekdir;
132
  ```
133
 
134
  The type `seekdir` is an enumerated type ([[enumerated.types]]) that
135
  contains the elements indicated in
136
  Table  [[tab:iostreams.seekdir.effects]].
@@ -160,11 +170,11 @@ namespace std {
160
 
161
  The class `Init` describes an object whose construction ensures the
162
  construction of the eight objects declared in `<iostream>` (
163
  [[iostream.objects]]) that associate file stream buffers with the
164
  standard C streams provided for by the functions declared in
165
- `<cstdio>` ([[c.files]]).
166
 
167
  For the sake of exposition, the maintained data is presented here as:
168
 
169
  - `static int init_cnt`, counts the number of constructor and destructor
170
  calls for class `Init`, initialized to zero.
 
10
  explicit failure(const char* msg, const error_code& ec = io_errc::stream);
11
  };
12
  }
13
  ```
14
 
15
+ An implementation is permitted to define `ios_base::failure` as a
16
+ synonym for a class with equivalent functionality to class
17
+ `ios_base::failure` shown in this subclause.
18
+
19
+ [*Note 1*: When `ios_base::failure` is a synonym for another type it
20
+ shall provide a nested type `failure`, to emulate the injected class
21
+ name. — *end note*]
22
+
23
  The class `failure` defines the base class for the types of all objects
24
  thrown as exceptions, by functions in the iostreams library, to report
25
  errors detected during stream buffer operations.
26
 
27
  When throwing `ios_base::failure` exceptions, implementations should
28
  provide values of `ec` that identify the specific reason for the
29
+ failure.
30
+
31
+ [*Note 2*: Errors arising from the operating system would typically be
32
  reported as `system_category()` errors with an error value of the error
33
  number reported by the operating system. Errors arising from within the
34
  stream library would typically be reported as
35
  `error_code(io_errc::stream,
36
+ iostream_category())`. — *end note*]
37
 
38
  ``` cpp
39
  explicit failure(const string& msg, const error_code& ec = io_errc::stream);
40
  ```
41
 
 
50
  base class with `msg` and `ec`.
51
 
52
  ##### Type `ios_base::fmtflags` <a id="ios::fmtflags">[[ios::fmtflags]]</a>
53
 
54
  ``` cpp
55
+ using fmtflags = T1;
56
  ```
57
 
58
  The type `fmtflags` is a bitmask type ([[bitmask.types]]). Setting its
59
  elements has the effects indicated in
60
  Table  [[tab:iostreams.fmtflags.effects]].
 
93
 
94
 
95
  ##### Type `ios_base::iostate` <a id="ios::iostate">[[ios::iostate]]</a>
96
 
97
  ``` cpp
98
+ using iostate = T2;
99
  ```
100
 
101
  The type `iostate` is a bitmask type ([[bitmask.types]]) that contains
102
  the elements indicated in Table  [[tab:iostreams.iostate.effects]].
103
 
 
115
  - `goodbit`, the value zero.
116
 
117
  ##### Type `ios_base::openmode` <a id="ios::openmode">[[ios::openmode]]</a>
118
 
119
  ``` cpp
120
+ using openmode = T3;
121
  ```
122
 
123
  The type `openmode` is a bitmask type ([[bitmask.types]]). It contains
124
  the elements indicated in Table  [[tab:iostreams.openmode.effects]].
125
 
 
136
 
137
 
138
  ##### Type `ios_base::seekdir` <a id="ios::seekdir">[[ios::seekdir]]</a>
139
 
140
  ``` cpp
141
+ using seekdir = T4;
142
  ```
143
 
144
  The type `seekdir` is an enumerated type ([[enumerated.types]]) that
145
  contains the elements indicated in
146
  Table  [[tab:iostreams.seekdir.effects]].
 
170
 
171
  The class `Init` describes an object whose construction ensures the
172
  construction of the eight objects declared in `<iostream>` (
173
  [[iostream.objects]]) that associate file stream buffers with the
174
  standard C streams provided for by the functions declared in
175
+ `<cstdio>` ([[cstdio.syn]]).
176
 
177
  For the sake of exposition, the maintained data is presented here as:
178
 
179
  - `static int init_cnt`, counts the number of constructor and destructor
180
  calls for class `Init`, initialized to zero.