tmp/tmprbov8w1f/{from.md → to.md}
RENAMED
|
@@ -53,11 +53,11 @@ return std::move(lhs);
|
|
| 53 |
|
| 54 |
except that both `lhs` and `rhs` are left in valid but unspecified
|
| 55 |
states.
|
| 56 |
|
| 57 |
[*Note 1*: If `lhs` and `rhs` have equal allocators, the implementation
|
| 58 |
-
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
template<class charT, class traits, class Allocator>
|
| 62 |
constexpr basic_string<charT, traits, Allocator>
|
| 63 |
operator+(const basic_string<charT, traits, Allocator>& lhs,
|
|
@@ -140,11 +140,11 @@ template<class charT, class traits, class Allocator>
|
|
| 140 |
``` cpp
|
| 141 |
lhs.push_back(rhs);
|
| 142 |
return std::move(lhs);
|
| 143 |
```
|
| 144 |
|
| 145 |
-
#### Non-member comparison functions <a id="string.cmp">[[string.cmp]]</a>
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
template<class charT, class traits, class Allocator>
|
| 149 |
constexpr bool
|
| 150 |
operator==(const basic_string<charT, traits, Allocator>& lhs,
|
|
@@ -187,28 +187,27 @@ template<class charT, class traits, class Allocator>
|
|
| 187 |
operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);
|
| 188 |
```
|
| 189 |
|
| 190 |
*Effects:* Behaves as a formatted input
|
| 191 |
function [[istream.formatted.reqmts]]. After constructing a `sentry`
|
| 192 |
-
object, if the sentry
|
| 193 |
-
|
| 194 |
-
`str.append(1, c)`. If
|
| 195 |
-
|
| 196 |
-
`
|
| 197 |
-
following occurs:
|
| 198 |
|
| 199 |
- *n* characters are stored;
|
| 200 |
- end-of-file occurs on the input sequence;
|
| 201 |
- `isspace(c, is.getloc())` is `true` for the next available input
|
| 202 |
character *c*.
|
| 203 |
|
| 204 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 205 |
and the `sentry` object is destroyed.
|
| 206 |
|
| 207 |
-
If the function extracts no characters,
|
| 208 |
-
|
| 209 |
-
[[iostate.flags]].
|
| 210 |
|
| 211 |
*Returns:* `is`.
|
| 212 |
|
| 213 |
``` cpp
|
| 214 |
template<class charT, class traits, class Allocator>
|
|
@@ -234,28 +233,26 @@ template<class charT, class traits, class Allocator>
|
|
| 234 |
```
|
| 235 |
|
| 236 |
*Effects:* Behaves as an unformatted input
|
| 237 |
function [[istream.unformatted]], except that it does not affect the
|
| 238 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 239 |
-
constructing a `sentry` object, if the sentry
|
| 240 |
-
|
| 241 |
-
`
|
| 242 |
-
occurs:
|
| 243 |
|
| 244 |
-
- end-of-file occurs on the input sequence
|
| 245 |
-
function calls `is.setstate(ios_base::eofbit)`).
|
| 246 |
- `traits::eq(c, delim)` for the next available input character *c* (in
|
| 247 |
-
which case, *c* is extracted but not appended)
|
| 248 |
-
- `str.max_size()` characters are stored (in which case,
|
| 249 |
-
|
| 250 |
|
| 251 |
The conditions are tested in the order shown. In any case, after the
|
| 252 |
last character is extracted, the `sentry` object is destroyed.
|
| 253 |
|
| 254 |
-
If the function extracts no characters,
|
| 255 |
-
|
| 256 |
-
[[iostate.flags]].
|
| 257 |
|
| 258 |
*Returns:* `is`.
|
| 259 |
|
| 260 |
``` cpp
|
| 261 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 53 |
|
| 54 |
except that both `lhs` and `rhs` are left in valid but unspecified
|
| 55 |
states.
|
| 56 |
|
| 57 |
[*Note 1*: If `lhs` and `rhs` have equal allocators, the implementation
|
| 58 |
+
can move from either. — *end note*]
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
template<class charT, class traits, class Allocator>
|
| 62 |
constexpr basic_string<charT, traits, Allocator>
|
| 63 |
operator+(const basic_string<charT, traits, Allocator>& lhs,
|
|
|
|
| 140 |
``` cpp
|
| 141 |
lhs.push_back(rhs);
|
| 142 |
return std::move(lhs);
|
| 143 |
```
|
| 144 |
|
| 145 |
+
#### Non-member comparison operator functions <a id="string.cmp">[[string.cmp]]</a>
|
| 146 |
|
| 147 |
``` cpp
|
| 148 |
template<class charT, class traits, class Allocator>
|
| 149 |
constexpr bool
|
| 150 |
operator==(const basic_string<charT, traits, Allocator>& lhs,
|
|
|
|
| 187 |
operator>>(basic_istream<charT, traits>& is, basic_string<charT, traits, Allocator>& str);
|
| 188 |
```
|
| 189 |
|
| 190 |
*Effects:* Behaves as a formatted input
|
| 191 |
function [[istream.formatted.reqmts]]. After constructing a `sentry`
|
| 192 |
+
object, if the `sentry` object returns `true` when converted to a value
|
| 193 |
+
of type `bool`, calls `str.erase()` and then extracts characters from
|
| 194 |
+
`is` and appends them to `str` as if by calling `str.append(1, c)`. If
|
| 195 |
+
`is.width()` is greater than zero, the maximum number `n` of characters
|
| 196 |
+
appended is `is.width()`; otherwise `n` is `str.max_size()`. Characters
|
| 197 |
+
are extracted and appended until any of the following occurs:
|
| 198 |
|
| 199 |
- *n* characters are stored;
|
| 200 |
- end-of-file occurs on the input sequence;
|
| 201 |
- `isspace(c, is.getloc())` is `true` for the next available input
|
| 202 |
character *c*.
|
| 203 |
|
| 204 |
After the last character (if any) is extracted, `is.width(0)` is called
|
| 205 |
and the `sentry` object is destroyed.
|
| 206 |
|
| 207 |
+
If the function extracts no characters, `ios_base::failbit` is set in
|
| 208 |
+
the input function’s local error state before `setstate` is called.
|
|
|
|
| 209 |
|
| 210 |
*Returns:* `is`.
|
| 211 |
|
| 212 |
``` cpp
|
| 213 |
template<class charT, class traits, class Allocator>
|
|
|
|
| 233 |
```
|
| 234 |
|
| 235 |
*Effects:* Behaves as an unformatted input
|
| 236 |
function [[istream.unformatted]], except that it does not affect the
|
| 237 |
value returned by subsequent calls to `basic_istream<>::gcount()`. After
|
| 238 |
+
constructing a `sentry` object, if the `sentry` object returns `true`
|
| 239 |
+
when converted to a value of type `bool`, calls `str.erase()` and then
|
| 240 |
+
extracts characters from `is` and appends them to `str` as if by calling
|
| 241 |
+
`str.append(1, c)` until any of the following occurs:
|
| 242 |
|
| 243 |
+
- end-of-file occurs on the input sequence;
|
|
|
|
| 244 |
- `traits::eq(c, delim)` for the next available input character *c* (in
|
| 245 |
+
which case, *c* is extracted but not appended);
|
| 246 |
+
- `str.max_size()` characters are stored (in which case,
|
| 247 |
+
`ios_base::failbit` is set in the input function’s local error state).
|
| 248 |
|
| 249 |
The conditions are tested in the order shown. In any case, after the
|
| 250 |
last character is extracted, the `sentry` object is destroyed.
|
| 251 |
|
| 252 |
+
If the function extracts no characters, `ios_base::failbit` is set in
|
| 253 |
+
the input function’s local error state before `setstate` is called.
|
|
|
|
| 254 |
|
| 255 |
*Returns:* `is`.
|
| 256 |
|
| 257 |
``` cpp
|
| 258 |
template<class charT, class traits, class Allocator>
|