From Jason Turner

[istream.unformatted]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmph9q78x88/{from.md → to.md} +11 -11
tmp/tmph9q78x88/{from.md → to.md} RENAMED
@@ -9,11 +9,11 @@ an exception or if the sentry object returns false, when converted to a
9
  value of type `bool`, the function returns without attempting to obtain
10
  any input. In either case the number of extracted characters is set to
11
  0; unformatted input functions taking a character array of non-zero size
12
  as an argument shall also store a null character (using `charT()`) in
13
  the first location of the array. If an exception is thrown during input
14
- then `ios::badbit` is turned on[^21] in `*this`’s error state.
15
  (Exceptions thrown from `basic_ios<>::clear()` are not caught or
16
  rethrown.) If `(exceptions()&badbit) != 0` then the exception is
17
  rethrown. It also counts the number of characters extracted. If no
18
  exception has been thrown it ends by storing the count in a member
19
  object and returning the value specified. In any event the `sentry`
@@ -46,11 +46,11 @@ basic_istream<charT,traits>& get(char_type& c);
46
  ```
47
 
48
  *Effects:* Behaves as an unformatted input function (as described
49
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
50
  object, extracts a character, if one is available, and assigns it to
51
- `c`.[^22] Otherwise, the function calls `setstate(failbit)` (which may
52
  throw `ios_base::failure` ([[iostate.flags]])).
53
 
54
  *Returns:* `*this`.
55
 
56
  ``` cpp
@@ -59,11 +59,11 @@ basic_istream<charT,traits>& get(char_type* s, streamsize n,
59
  ```
60
 
61
  *Effects:* Behaves as an unformatted input function (as described
62
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
63
  object, extracts characters and stores them into successive locations of
64
- an array whose first element is designated by `s`.[^23] Characters are
65
  extracted and stored until any of the following occurs:
66
 
67
  - `n` is less than one or `n - 1` characters are stored;
68
  - end-of-file occurs on the input sequence (in which case the function
69
  calls `setstate(eofbit)`);
@@ -76,11 +76,11 @@ if `n` is greater than zero it then stores a null character into the
76
  next successive location of the array.
77
 
78
  *Returns:* `*this`.
79
 
80
  ``` cpp
81
- basic_istream<charT,traits>& get(char_type* s, streamsize n)
82
  ```
83
 
84
  *Effects:* Calls `get(s,n,widen(’\n’))`
85
 
86
  *Returns:* Value returned by the call.
@@ -123,25 +123,25 @@ basic_istream<charT,traits>& getline(char_type* s, streamsize n,
123
  ```
124
 
125
  *Effects:* Behaves as an unformatted input function (as described
126
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
127
  object, extracts characters and stores them into successive locations of
128
- an array whose first element is designated by `s`.[^24] Characters are
129
  extracted and stored until one of the following occurs:
130
 
131
  1. end-of-file occurs on the input sequence (in which case the function
132
  calls `setstate(eofbit)`);
133
  2. `traits::eq(c, delim)` for the next available input character `c`
134
  (in which case the input character is extracted but not
135
- stored);[^25]
136
  3. `n` is less than one or `n - 1` characters are stored (in which case
137
  the function calls `setstate(failbit)`).
138
 
139
- These conditions are tested in the order shown.[^26]
140
 
141
  If the function extracts no characters, it calls `setstate(failbit)`
142
- (which may throw `ios_base::failure` ([[iostate.flags]])).[^27]
143
 
144
  In any case, if `n` is greater than zero, it then stores a null
145
  character (using `charT()`) into the next successive location of the
146
  array.
147
 
@@ -186,12 +186,12 @@ basic_istream<charT,traits>&
186
  *Effects:* Behaves as an unformatted input function (as described
187
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
188
  object, extracts characters and discards them. Characters are extracted
189
  until any of the following occurs:
190
 
191
- - if `n != numeric_limits<streamsize>::max()` ([[limits]]), `n`
192
- characters are extracted
193
  - end-of-file occurs on the input sequence (in which case the function
194
  calls `setstate(eofbit)`, which may throw
195
  `ios_base::failure` ([[iostate.flags]]));
196
  - `traits::eq_int_type(traits::to_int_type(c), delim)` for the next
197
  available input character `c` (in which case `c` is extracted).
@@ -219,11 +219,11 @@ basic_istream<charT,traits>& read(char_type* s, streamsize n);
219
  *Effects:* Behaves as an unformatted input function (as described
220
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
221
  object, if `!good()` calls `setstate(failbit)` which may throw an
222
  exception, and return. Otherwise extracts characters and stores them
223
  into successive locations of an array whose first element is designated
224
- by `s`.[^28] Characters are extracted and stored until either of the
225
  following occurs:
226
 
227
  - `n` characters are stored;
228
  - end-of-file occurs on the input sequence (in which case the function
229
  calls `setstate(failbit | eofbit)`, which may throw
 
9
  value of type `bool`, the function returns without attempting to obtain
10
  any input. In either case the number of extracted characters is set to
11
  0; unformatted input functions taking a character array of non-zero size
12
  as an argument shall also store a null character (using `charT()`) in
13
  the first location of the array. If an exception is thrown during input
14
+ then `ios::badbit` is turned on[^22] in `*this`’s error state.
15
  (Exceptions thrown from `basic_ios<>::clear()` are not caught or
16
  rethrown.) If `(exceptions()&badbit) != 0` then the exception is
17
  rethrown. It also counts the number of characters extracted. If no
18
  exception has been thrown it ends by storing the count in a member
19
  object and returning the value specified. In any event the `sentry`
 
46
  ```
47
 
48
  *Effects:* Behaves as an unformatted input function (as described
49
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
50
  object, extracts a character, if one is available, and assigns it to
51
+ `c`.[^23] Otherwise, the function calls `setstate(failbit)` (which may
52
  throw `ios_base::failure` ([[iostate.flags]])).
53
 
54
  *Returns:* `*this`.
55
 
56
  ``` cpp
 
59
  ```
60
 
61
  *Effects:* Behaves as an unformatted input function (as described
62
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
63
  object, extracts characters and stores them into successive locations of
64
+ an array whose first element is designated by `s`.[^24] Characters are
65
  extracted and stored until any of the following occurs:
66
 
67
  - `n` is less than one or `n - 1` characters are stored;
68
  - end-of-file occurs on the input sequence (in which case the function
69
  calls `setstate(eofbit)`);
 
76
  next successive location of the array.
77
 
78
  *Returns:* `*this`.
79
 
80
  ``` cpp
81
+ basic_istream<charT,traits>& get(char_type* s, streamsize n);
82
  ```
83
 
84
  *Effects:* Calls `get(s,n,widen(’\n’))`
85
 
86
  *Returns:* Value returned by the call.
 
123
  ```
124
 
125
  *Effects:* Behaves as an unformatted input function (as described
126
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
127
  object, extracts characters and stores them into successive locations of
128
+ an array whose first element is designated by `s`.[^25] Characters are
129
  extracted and stored until one of the following occurs:
130
 
131
  1. end-of-file occurs on the input sequence (in which case the function
132
  calls `setstate(eofbit)`);
133
  2. `traits::eq(c, delim)` for the next available input character `c`
134
  (in which case the input character is extracted but not
135
+ stored);[^26]
136
  3. `n` is less than one or `n - 1` characters are stored (in which case
137
  the function calls `setstate(failbit)`).
138
 
139
+ These conditions are tested in the order shown.[^27]
140
 
141
  If the function extracts no characters, it calls `setstate(failbit)`
142
+ (which may throw `ios_base::failure` ([[iostate.flags]])).[^28]
143
 
144
  In any case, if `n` is greater than zero, it then stores a null
145
  character (using `charT()`) into the next successive location of the
146
  array.
147
 
 
186
  *Effects:* Behaves as an unformatted input function (as described
187
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
188
  object, extracts characters and discards them. Characters are extracted
189
  until any of the following occurs:
190
 
191
+ - `n != numeric_limits<streamsize>::max()` ([[limits]]) and `n`
192
+ characters have been extracted so far
193
  - end-of-file occurs on the input sequence (in which case the function
194
  calls `setstate(eofbit)`, which may throw
195
  `ios_base::failure` ([[iostate.flags]]));
196
  - `traits::eq_int_type(traits::to_int_type(c), delim)` for the next
197
  available input character `c` (in which case `c` is extracted).
 
219
  *Effects:* Behaves as an unformatted input function (as described
220
  in  [[istream.unformatted]], paragraph 1). After constructing a sentry
221
  object, if `!good()` calls `setstate(failbit)` which may throw an
222
  exception, and return. Otherwise extracts characters and stores them
223
  into successive locations of an array whose first element is designated
224
+ by `s`.[^29] Characters are extracted and stored until either of the
225
  following occurs:
226
 
227
  - `n` characters are stored;
228
  - end-of-file occurs on the input sequence (in which case the function
229
  calls `setstate(failbit | eofbit)`, which may throw