tmp/tmpuy7vn5j0/{from.md → to.md}
RENAMED
|
@@ -6,28 +6,27 @@ template<class charT, class traits, class Allocator>
|
|
| 6 |
operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);
|
| 7 |
```
|
| 8 |
|
| 9 |
*Effects:* Behaves as a formatted input
|
| 10 |
function [[istream.formatted.reqmts]]. After constructing a `sentry`
|
| 11 |
-
object, if the sentry
|
| 12 |
-
|
| 13 |
-
`str.append(1, c)`. If
|
| 14 |
-
|
| 15 |
-
`
|
| 16 |
-
following occurs:
|
| 17 |
|
| 18 |
- *n* characters are stored;
|
| 19 |
- end-of-file occurs on the input sequence;
|
| 20 |
- `isspace(c, is.getloc())` is `true` for the next available input
|
| 21 |
character *c*.
|
| 22 |
|
| 23 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 24 |
and the `sentry` object is destroyed.
|
| 25 |
|
| 26 |
-
If the function extracts no characters,
|
| 27 |
-
|
| 28 |
-
[[iostate.flags]].
|
| 29 |
|
| 30 |
*Returns:* `is`.
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
template<class charT, class traits, class Allocator>
|
|
@@ -53,28 +52,26 @@ template<class charT, class traits, class Allocator>
|
|
| 53 |
```
|
| 54 |
|
| 55 |
*Effects:* Behaves as an unformatted input
|
| 56 |
function [[istream.unformatted]], except that it does not affect the
|
| 57 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 58 |
-
constructing a `sentry` object, if the sentry
|
| 59 |
-
|
| 60 |
-
`
|
| 61 |
-
occurs:
|
| 62 |
|
| 63 |
-
- end-of-file occurs on the input sequence
|
| 64 |
-
function calls `is.setstate(ios_base::eofbit)`).
|
| 65 |
- `traits::eq(c, delim)` for the next available input character *c* (in
|
| 66 |
-
which case, *c* is extracted but not appended)
|
| 67 |
-
- `str.max_size()` characters are stored (in which case,
|
| 68 |
-
|
| 69 |
|
| 70 |
The conditions are tested in the order shown. In any case, after the
|
| 71 |
last character is extracted, the `sentry` object is destroyed.
|
| 72 |
|
| 73 |
-
If the function extracts no characters,
|
| 74 |
-
|
| 75 |
-
[[iostate.flags]].
|
| 76 |
|
| 77 |
*Returns:* `is`.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 6 |
operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);
|
| 7 |
```
|
| 8 |
|
| 9 |
*Effects:* Behaves as a formatted input
|
| 10 |
function [[istream.formatted.reqmts]]. After constructing a `sentry`
|
| 11 |
+
object, if the `sentry` object returns `true` when converted to a value
|
| 12 |
+
of type `bool`, calls `str.erase()` and then extracts characters from
|
| 13 |
+
`is` and appends them to `str` as if by calling `str.append(1, c)`. If
|
| 14 |
+
`is.width()` is greater than zero, the maximum number `n` of characters
|
| 15 |
+
appended is `is.width()`; otherwise `n` is `str.max_size()`. Characters
|
| 16 |
+
are extracted and appended until any of the following occurs:
|
| 17 |
|
| 18 |
- *n* characters are stored;
|
| 19 |
- end-of-file occurs on the input sequence;
|
| 20 |
- `isspace(c, is.getloc())` is `true` for the next available input
|
| 21 |
character *c*.
|
| 22 |
|
| 23 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 24 |
and the `sentry` object is destroyed.
|
| 25 |
|
| 26 |
+
If the function extracts no characters, `ios_base::failbit` is set in
|
| 27 |
+
the input function’s local error state before `setstate` is called.
|
|
|
|
| 28 |
|
| 29 |
*Returns:* `is`.
|
| 30 |
|
| 31 |
``` cpp
|
| 32 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 52 |
```
|
| 53 |
|
| 54 |
*Effects:* Behaves as an unformatted input
|
| 55 |
function [[istream.unformatted]], except that it does not affect the
|
| 56 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 57 |
+
constructing a `sentry` object, if the `sentry` object returns `true`
|
| 58 |
+
when converted to a value of type `bool`, calls `str.erase()` and then
|
| 59 |
+
extracts characters from `is` and appends them to `str` as if by calling
|
| 60 |
+
`str.append(1, c)` until any of the following occurs:
|
| 61 |
|
| 62 |
+
- end-of-file occurs on the input sequence;
|
|
|
|
| 63 |
- `traits::eq(c, delim)` for the next available input character *c* (in
|
| 64 |
+
which case, *c* is extracted but not appended);
|
| 65 |
+
- `str.max_size()` characters are stored (in which case,
|
| 66 |
+
`ios_base::failbit` is set in the input function’s local error state).
|
| 67 |
|
| 68 |
The conditions are tested in the order shown. In any case, after the
|
| 69 |
last character is extracted, the `sentry` object is destroyed.
|
| 70 |
|
| 71 |
+
If the function extracts no characters, `ios_base::failbit` is set in
|
| 72 |
+
the input function’s local error state before `setstate` is called.
|
|
|
|
| 73 |
|
| 74 |
*Returns:* `is`.
|
| 75 |
|
| 76 |
``` cpp
|
| 77 |
template<class charT, class traits, class Allocator>
|