tmp/tmpwaaffh4d/{from.md → to.md}
RENAMED
|
@@ -7,47 +7,40 @@ template<class charT, class traits, class Allocator>
|
|
| 7 |
basic_string<charT, traits, Allocator>& str);
|
| 8 |
```
|
| 9 |
|
| 10 |
*Effects:* Behaves as a formatted input
|
| 11 |
function ([[istream.formatted.reqmts]]). After constructing a `sentry`
|
| 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
|
| 17 |
following occurs:
|
| 18 |
|
| 19 |
- *n* characters are stored;
|
| 20 |
- end-of-file occurs on the input sequence;
|
| 21 |
-
- `isspace(c,is.getloc())` is true for the next available input
|
| 22 |
character *c*.
|
| 23 |
|
| 24 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 25 |
-
and the `sentry` object
|
| 26 |
|
| 27 |
If the function extracts no characters, it calls
|
| 28 |
`is.setstate(ios::failbit)`, which may throw
|
| 29 |
`ios_base::failure` ([[iostate.flags]]).
|
| 30 |
|
| 31 |
-
*Returns:* `is`
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
template<class charT, class traits, class Allocator>
|
| 35 |
basic_ostream<charT, traits>&
|
| 36 |
operator<<(basic_ostream<charT, traits>& os,
|
| 37 |
const basic_string<charT, traits, Allocator>& str);
|
| 38 |
```
|
| 39 |
|
| 40 |
-
*Effects:*
|
| 41 |
-
|
| 42 |
-
sequence `seq`, initially consisting of the elements defined by the
|
| 43 |
-
range \[`str.begin(), str.end()`). Determines padding for `seq` as
|
| 44 |
-
described in [[ostream.formatted.reqmts]]. Then inserts `seq` as if by
|
| 45 |
-
calling `os.rdbuf()->sputn(seq, n)`, where `n` is the larger of
|
| 46 |
-
`os.width()` and `str.size()`; then calls `os.width(0)`.
|
| 47 |
-
|
| 48 |
-
*Returns:* `os`
|
| 49 |
|
| 50 |
``` cpp
|
| 51 |
template<class charT, class traits, class Allocator>
|
| 52 |
basic_istream<charT, traits>&
|
| 53 |
getline(basic_istream<charT, traits>& is,
|
|
@@ -61,11 +54,11 @@ template<class charT, class traits, class Allocator>
|
|
| 61 |
```
|
| 62 |
|
| 63 |
*Effects:* Behaves as an unformatted input
|
| 64 |
function ([[istream.unformatted]]), except that it does not affect the
|
| 65 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 66 |
-
constructing a `sentry` object, if the sentry converts to true, calls
|
| 67 |
`str.erase()` and then extracts characters from `is` and appends them to
|
| 68 |
`str` as if by calling `str.append(1, c)` until any of the following
|
| 69 |
occurs:
|
| 70 |
|
| 71 |
- end-of-file occurs on the input sequence (in which case, the `getline`
|
|
@@ -74,11 +67,11 @@ occurs:
|
|
| 74 |
which case, *c* is extracted but not appended) ([[iostate.flags]])
|
| 75 |
- `str.max_size()` characters are stored (in which case, the function
|
| 76 |
calls `is.setstate(ios_base::failbit))` ([[iostate.flags]])
|
| 77 |
|
| 78 |
The conditions are tested in the order shown. In any case, after the
|
| 79 |
-
last character is extracted, the `sentry` object
|
| 80 |
|
| 81 |
If the function extracts no characters, it calls
|
| 82 |
`is.setstate(ios_base::failbit)` which may throw
|
| 83 |
`ios_base::failure` ([[iostate.flags]]).
|
| 84 |
|
|
@@ -93,7 +86,7 @@ template<class charT, class traits, class Allocator>
|
|
| 93 |
basic_istream<charT, traits>&
|
| 94 |
getline(basic_istream<charT, traits>&& is,
|
| 95 |
basic_string<charT, traits, Allocator>& str);
|
| 96 |
```
|
| 97 |
|
| 98 |
-
*Returns:* `getline(is,str,is.widen(’\n’))`
|
| 99 |
|
|
|
|
| 7 |
basic_string<charT, traits, Allocator>& str);
|
| 8 |
```
|
| 9 |
|
| 10 |
*Effects:* Behaves as a formatted input
|
| 11 |
function ([[istream.formatted.reqmts]]). After constructing a `sentry`
|
| 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
|
| 17 |
following occurs:
|
| 18 |
|
| 19 |
- *n* characters are stored;
|
| 20 |
- end-of-file occurs on the input sequence;
|
| 21 |
+
- `isspace(c, is.getloc())` is `true` for the next available input
|
| 22 |
character *c*.
|
| 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(ios::failbit)`, which may throw
|
| 29 |
`ios_base::failure` ([[iostate.flags]]).
|
| 30 |
|
| 31 |
+
*Returns:* `is`.
|
| 32 |
|
| 33 |
``` cpp
|
| 34 |
template<class charT, class traits, class Allocator>
|
| 35 |
basic_ostream<charT, traits>&
|
| 36 |
operator<<(basic_ostream<charT, traits>& os,
|
| 37 |
const basic_string<charT, traits, Allocator>& str);
|
| 38 |
```
|
| 39 |
|
| 40 |
+
*Effects:* Equivalent to:
|
| 41 |
+
`return os << basic_string_view<charT, traits>(str);`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
``` cpp
|
| 44 |
template<class charT, class traits, class Allocator>
|
| 45 |
basic_istream<charT, traits>&
|
| 46 |
getline(basic_istream<charT, traits>& is,
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
*Effects:* Behaves as an unformatted input
|
| 57 |
function ([[istream.unformatted]]), except that it does not affect the
|
| 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`
|
|
|
|
| 67 |
which case, *c* is extracted but not appended) ([[iostate.flags]])
|
| 68 |
- `str.max_size()` characters are stored (in which case, the function
|
| 69 |
calls `is.setstate(ios_base::failbit))` ([[iostate.flags]])
|
| 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 |
`ios_base::failure` ([[iostate.flags]]).
|
| 77 |
|
|
|
|
| 86 |
basic_istream<charT, traits>&
|
| 87 |
getline(basic_istream<charT, traits>&& is,
|
| 88 |
basic_string<charT, traits, Allocator>& str);
|
| 89 |
```
|
| 90 |
|
| 91 |
+
*Returns:* `getline(is, str, is.widen(’\n’))`.
|
| 92 |
|