tmp/tmpcjm9vwvf/{from.md → to.md}
RENAMED
|
@@ -1,12 +1,22 @@
|
|
| 1 |
##### Common requirements <a id="istream.formatted.reqmts">[[istream.formatted.reqmts]]</a>
|
| 2 |
|
| 3 |
Each formatted input function begins execution by constructing an object
|
| 4 |
-
of
|
|
|
|
|
|
|
| 5 |
`sentry` object returns `true`, when converted to a value of type
|
| 6 |
-
`bool`, the function endeavors to obtain the requested input.
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
the
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
|
|
|
| 1 |
##### Common requirements <a id="istream.formatted.reqmts">[[istream.formatted.reqmts]]</a>
|
| 2 |
|
| 3 |
Each formatted input function begins execution by constructing an object
|
| 4 |
+
of type `ios_base::iostate`, termed the local error state, and
|
| 5 |
+
initializing it to `ios_base::goodbit`. It then creates an object of
|
| 6 |
+
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. Otherwise,
|
| 9 |
+
if the `sentry` constructor exits by throwing an exception or if the
|
| 10 |
+
`sentry` object produces `false` when converted to a value of type
|
| 11 |
+
`bool`, the function returns without attempting to obtain any input. If
|
| 12 |
+
`rdbuf()->sbumpc()` or `rdbuf()->sgetc()` returns `traits::eof()`, then
|
| 13 |
+
`ios_base::eofbit` is set in the local error state and the input
|
| 14 |
+
function stops trying to obtain the requested input. If an exception is
|
| 15 |
+
thrown during input then `ios_base::badbit` is set in the local error
|
| 16 |
+
state, `*this`’s error state is set to the local error state, and the
|
| 17 |
+
exception is rethrown if `(exceptions() & badbit) != 0`. After
|
| 18 |
+
extraction is done, the input function calls `setstate`, which sets
|
| 19 |
+
`*this`’s error state to the local error state, and may throw an
|
| 20 |
+
exception. In any case, the formatted input function destroys the
|
| 21 |
+
`sentry` object. If no exception has been thrown, it returns `*this`.
|
| 22 |
|