tmp/tmps_3cv__0/{from.md → to.md}
RENAMED
|
@@ -1,16 +1,15 @@
|
|
| 1 |
#### Inserters and extractors <a id="string.io">[[string.io]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class charT, class traits, class Allocator>
|
| 5 |
basic_istream<charT, traits>&
|
| 6 |
-
operator>>(basic_istream<charT, traits>& is,
|
| 7 |
-
basic_string<charT, traits, Allocator>& str);
|
| 8 |
```
|
| 9 |
|
| 10 |
*Effects:* Behaves as a formatted input
|
| 11 |
-
function
|
| 12 |
object, if the sentry converts to `true`, calls `str.erase()` and then
|
| 13 |
extracts characters from `is` and appends them to `str` as if by calling
|
| 14 |
`str.append(1, c)`. If `is.width()` is greater than zero, the maximum
|
| 15 |
number `n` of characters appended is `is.width()`; otherwise `n` is
|
| 16 |
`str.max_size()`. Characters are extracted and appended until any of the
|
|
@@ -23,12 +22,12 @@ following occurs:
|
|
| 23 |
|
| 24 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 25 |
and the `sentry` object is destroyed.
|
| 26 |
|
| 27 |
If the function extracts no characters, it calls
|
| 28 |
-
`is.setstate(
|
| 29 |
-
|
| 30 |
|
| 31 |
*Returns:* `is`.
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
template<class charT, class traits, class Allocator>
|
|
@@ -52,30 +51,30 @@ template<class charT, class traits, class Allocator>
|
|
| 52 |
basic_string<charT, traits, Allocator>& str,
|
| 53 |
charT delim);
|
| 54 |
```
|
| 55 |
|
| 56 |
*Effects:* Behaves as an unformatted input
|
| 57 |
-
function
|
| 58 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 59 |
constructing a `sentry` object, if the sentry converts to `true`, calls
|
| 60 |
`str.erase()` and then extracts characters from `is` and appends them to
|
| 61 |
`str` as if by calling `str.append(1, c)` until any of the following
|
| 62 |
occurs:
|
| 63 |
|
| 64 |
- end-of-file occurs on the input sequence (in which case, the `getline`
|
| 65 |
function calls `is.setstate(ios_base::eofbit)`).
|
| 66 |
- `traits::eq(c, delim)` for the next available input character *c* (in
|
| 67 |
-
which case, *c* is extracted but not appended)
|
| 68 |
- `str.max_size()` characters are stored (in which case, the function
|
| 69 |
-
calls `is.setstate(ios_base::failbit))`
|
| 70 |
|
| 71 |
The conditions are tested in the order shown. In any case, after the
|
| 72 |
last character is extracted, the `sentry` object is destroyed.
|
| 73 |
|
| 74 |
If the function extracts no characters, it calls
|
| 75 |
-
`is.setstate(ios_base::failbit)` which may throw
|
| 76 |
-
|
| 77 |
|
| 78 |
*Returns:* `is`.
|
| 79 |
|
| 80 |
``` cpp
|
| 81 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 1 |
#### Inserters and extractors <a id="string.io">[[string.io]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class charT, class traits, class Allocator>
|
| 5 |
basic_istream<charT, traits>&
|
| 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 converts to `true`, calls `str.erase()` and then
|
| 12 |
extracts characters from `is` and appends them to `str` as if by calling
|
| 13 |
`str.append(1, c)`. If `is.width()` is greater than zero, the maximum
|
| 14 |
number `n` of characters appended is `is.width()`; otherwise `n` is
|
| 15 |
`str.max_size()`. Characters are extracted and appended until any of the
|
|
|
|
| 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, it calls
|
| 27 |
+
`is.setstate(ios_base::failbit)`, which may throw `ios_base::failure`
|
| 28 |
+
[[iostate.flags]].
|
| 29 |
|
| 30 |
*Returns:* `is`.
|
| 31 |
|
| 32 |
``` cpp
|
| 33 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 51 |
basic_string<charT, traits, Allocator>& str,
|
| 52 |
charT delim);
|
| 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 converts to `true`, calls
|
| 59 |
`str.erase()` and then extracts characters from `is` and appends them to
|
| 60 |
`str` as if by calling `str.append(1, c)` until any of the following
|
| 61 |
occurs:
|
| 62 |
|
| 63 |
- end-of-file occurs on the input sequence (in which case, the `getline`
|
| 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) [[iostate.flags]]
|
| 67 |
- `str.max_size()` characters are stored (in which case, the function
|
| 68 |
+
calls `is.setstate(ios_base::failbit))` [[iostate.flags]]
|
| 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, it calls
|
| 74 |
+
`is.setstate(ios_base::failbit)` which may throw `ios_base::failure`
|
| 75 |
+
[[iostate.flags]].
|
| 76 |
|
| 77 |
*Returns:* `is`.
|
| 78 |
|
| 79 |
``` cpp
|
| 80 |
template<class charT, class traits, class Allocator>
|