tmp/tmpp7o7pe99/{from.md → to.md}
RENAMED
|
@@ -4,13 +4,13 @@
|
|
| 4 |
|
| 5 |
Each formatted input function begins execution by constructing an object
|
| 6 |
of class `sentry` with the `noskipws` (second) argument `false`. If the
|
| 7 |
`sentry` object returns `true`, when converted to a value of type
|
| 8 |
`bool`, the function endeavors to obtain the requested input. If an
|
| 9 |
-
exception is thrown during input then `
|
| 10 |
-
`*this`’s error state. If `(exceptions()&badbit) != 0` then
|
| 11 |
-
exception is rethrown. In any case, the formatted input function
|
| 12 |
destroys the `sentry` object. If no exception has been thrown, it
|
| 13 |
returns `*this`.
|
| 14 |
|
| 15 |
##### Arithmetic extractors <a id="istream.formatted.arithmetic">[[istream.formatted.arithmetic]]</a>
|
| 16 |
|
|
@@ -27,11 +27,11 @@ operator>>(long double& val);
|
|
| 27 |
operator>>(bool& val);
|
| 28 |
operator>>(void*& val);
|
| 29 |
```
|
| 30 |
|
| 31 |
As in the case of the inserters, these extractors depend on the locale’s
|
| 32 |
-
`num_get<>`
|
| 33 |
stream data. These extractors behave as formatted input functions (as
|
| 34 |
described in [[istream.formatted.reqmts]]). After a sentry object is
|
| 35 |
constructed, the conversion occurs as if performed by the following code
|
| 36 |
fragment:
|
| 37 |
|
|
@@ -131,26 +131,23 @@ formatted input function (as described
|
|
| 131 |
in [[istream.formatted.reqmts]]).
|
| 132 |
|
| 133 |
*Returns:* `*this`.
|
| 134 |
|
| 135 |
``` cpp
|
| 136 |
-
template<class charT, class traits>
|
| 137 |
-
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT
|
| 138 |
-
template<class traits>
|
| 139 |
-
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char
|
| 140 |
-
template<class traits>
|
| 141 |
-
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char
|
| 142 |
```
|
| 143 |
|
| 144 |
*Effects:* Behaves like a formatted input member (as described
|
| 145 |
in [[istream.formatted.reqmts]]) of `in`. After a `sentry` object is
|
| 146 |
-
constructed, `operator>>` extracts characters and stores them into
|
| 147 |
-
|
| 148 |
-
`
|
| 149 |
-
is the number of elements of the largest array of `char_type` that can
|
| 150 |
-
store a terminating `charT()`. `n` is the maximum number of characters
|
| 151 |
-
stored.
|
| 152 |
|
| 153 |
Characters are extracted and stored until any of the following occurs:
|
| 154 |
|
| 155 |
- `n-1` characters are stored;
|
| 156 |
- end of file occurs on the input sequence;
|
|
@@ -160,11 +157,11 @@ Characters are extracted and stored until any of the following occurs:
|
|
| 160 |
`operator>>` then stores a null byte (`charT()`) in the next position,
|
| 161 |
which may be the first position if no characters were extracted.
|
| 162 |
`operator>>` then calls `width(0)`.
|
| 163 |
|
| 164 |
If the function extracted no characters, it calls `setstate(failbit)`,
|
| 165 |
-
which may throw `ios_base::failure`
|
| 166 |
|
| 167 |
*Returns:* `in`.
|
| 168 |
|
| 169 |
``` cpp
|
| 170 |
template<class charT, class traits>
|
|
@@ -184,26 +181,26 @@ stored in `c`. Otherwise, the function calls `in.setstate(failbit)`.
|
|
| 184 |
|
| 185 |
``` cpp
|
| 186 |
basic_istream<charT, traits>& operator>>(basic_streambuf<charT, traits>* sb);
|
| 187 |
```
|
| 188 |
|
| 189 |
-
*Effects:* Behaves as an unformatted input
|
| 190 |
-
|
| 191 |
-
which may throw `ios_base::failure`
|
| 192 |
-
object is constructed, extracts
|
| 193 |
-
|
| 194 |
-
inserted until any of
|
|
|
|
| 195 |
|
| 196 |
- end-of-file occurs on the input sequence;
|
| 197 |
- inserting in the output sequence fails (in which case the character to
|
| 198 |
be inserted is not extracted);
|
| 199 |
- an exception occurs (in which case the exception is caught).
|
| 200 |
|
| 201 |
If the function inserts no characters, it calls `setstate(failbit)`,
|
| 202 |
-
which may throw `ios_base::failure`
|
| 203 |
-
|
| 204 |
-
characters from `*this` and `failbit` is
|
| 205 |
-
|
| 206 |
-
rethrown.
|
| 207 |
|
| 208 |
*Returns:* `*this`.
|
| 209 |
|
|
|
|
| 4 |
|
| 5 |
Each formatted input function begins execution by constructing an object
|
| 6 |
of class `sentry` with the `noskipws` (second) argument `false`. If the
|
| 7 |
`sentry` object returns `true`, when converted to a value of type
|
| 8 |
`bool`, the function endeavors to obtain the requested input. If an
|
| 9 |
+
exception is thrown during input then `ios_base::badbit` is turned
|
| 10 |
+
on[^20] in `*this`’s error state. If `(exceptions()&badbit) != 0` then
|
| 11 |
+
the exception is rethrown. In any case, the formatted input function
|
| 12 |
destroys the `sentry` object. If no exception has been thrown, it
|
| 13 |
returns `*this`.
|
| 14 |
|
| 15 |
##### Arithmetic extractors <a id="istream.formatted.arithmetic">[[istream.formatted.arithmetic]]</a>
|
| 16 |
|
|
|
|
| 27 |
operator>>(bool& val);
|
| 28 |
operator>>(void*& val);
|
| 29 |
```
|
| 30 |
|
| 31 |
As in the case of the inserters, these extractors depend on the locale’s
|
| 32 |
+
`num_get<>` [[locale.num.get]] object to perform parsing the input
|
| 33 |
stream data. These extractors behave as formatted input functions (as
|
| 34 |
described in [[istream.formatted.reqmts]]). After a sentry object is
|
| 35 |
constructed, the conversion occurs as if performed by the following code
|
| 36 |
fragment:
|
| 37 |
|
|
|
|
| 131 |
in [[istream.formatted.reqmts]]).
|
| 132 |
|
| 133 |
*Returns:* `*this`.
|
| 134 |
|
| 135 |
``` cpp
|
| 136 |
+
template<class charT, class traits, size_t N>
|
| 137 |
+
basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& in, charT (&s)[N]);
|
| 138 |
+
template<class traits, size_t N>
|
| 139 |
+
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, unsigned char (&s)[N]);
|
| 140 |
+
template<class traits, size_t N>
|
| 141 |
+
basic_istream<char, traits>& operator>>(basic_istream<char, traits>& in, signed char (&s)[N]);
|
| 142 |
```
|
| 143 |
|
| 144 |
*Effects:* Behaves like a formatted input member (as described
|
| 145 |
in [[istream.formatted.reqmts]]) of `in`. After a `sentry` object is
|
| 146 |
+
constructed, `operator>>` extracts characters and stores them into `s`.
|
| 147 |
+
If `width()` is greater than zero, `n` is `min(size_t(width()), N)`.
|
| 148 |
+
Otherwise `n` is `N`. `n` is the maximum number of characters stored.
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
Characters are extracted and stored until any of the following occurs:
|
| 151 |
|
| 152 |
- `n-1` characters are stored;
|
| 153 |
- end of file occurs on the input sequence;
|
|
|
|
| 157 |
`operator>>` then stores a null byte (`charT()`) in the next position,
|
| 158 |
which may be the first position if no characters were extracted.
|
| 159 |
`operator>>` then calls `width(0)`.
|
| 160 |
|
| 161 |
If the function extracted no characters, it calls `setstate(failbit)`,
|
| 162 |
+
which may throw `ios_base::failure` [[iostate.flags]].
|
| 163 |
|
| 164 |
*Returns:* `in`.
|
| 165 |
|
| 166 |
``` cpp
|
| 167 |
template<class charT, class traits>
|
|
|
|
| 181 |
|
| 182 |
``` cpp
|
| 183 |
basic_istream<charT, traits>& operator>>(basic_streambuf<charT, traits>* sb);
|
| 184 |
```
|
| 185 |
|
| 186 |
+
*Effects:* Behaves as an unformatted input
|
| 187 |
+
function [[istream.unformatted]]. If `sb` is null, calls
|
| 188 |
+
`setstate(failbit)`, which may throw `ios_base::failure`
|
| 189 |
+
[[iostate.flags]]. After a sentry object is constructed, extracts
|
| 190 |
+
characters from `*this` and inserts them in the output sequence
|
| 191 |
+
controlled by `sb`. Characters are extracted and inserted until any of
|
| 192 |
+
the following occurs:
|
| 193 |
|
| 194 |
- end-of-file occurs on the input sequence;
|
| 195 |
- inserting in the output sequence fails (in which case the character to
|
| 196 |
be inserted is not extracted);
|
| 197 |
- an exception occurs (in which case the exception is caught).
|
| 198 |
|
| 199 |
If the function inserts no characters, it calls `setstate(failbit)`,
|
| 200 |
+
which may throw `ios_base::failure` [[iostate.flags]]. If it inserted no
|
| 201 |
+
characters because it caught an exception thrown while extracting
|
| 202 |
+
characters from `*this` and `failbit` is set in `exceptions()`
|
| 203 |
+
[[iostate.flags]], then the caught exception is rethrown.
|
|
|
|
| 204 |
|
| 205 |
*Returns:* `*this`.
|
| 206 |
|