tmp/tmpo0e9tp9m/{from.md → to.md}
RENAMED
|
@@ -8,11 +8,11 @@ const charT* data() const noexcept;
|
|
| 8 |
```
|
| 9 |
|
| 10 |
*Returns:* A pointer `p` such that `p + i == &operator[](i)` for each
|
| 11 |
`i` in \[`0`, `size()`\].
|
| 12 |
|
| 13 |
-
*Complexity:*
|
| 14 |
|
| 15 |
*Requires:* The program shall not alter any of the values stored in the
|
| 16 |
character array.
|
| 17 |
|
| 18 |
``` cpp
|
|
@@ -44,26 +44,26 @@ Otherwise, returns `npos`.
|
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
size_type find(const charT* s, size_type pos, size_type n) const;
|
| 47 |
```
|
| 48 |
|
| 49 |
-
*Returns:* `find(basic_string
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
-
size_type find(const charT* s, size_type pos = 0) const
|
| 53 |
```
|
| 54 |
|
| 55 |
*Requires:* `s` points to an array of at least `traits::length(s) + 1`
|
| 56 |
elements of `charT`.
|
| 57 |
|
| 58 |
*Returns:* `find(basic_string(s), pos)`.
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
-
size_type find(charT c, size_type pos = 0) const
|
| 62 |
```
|
| 63 |
|
| 64 |
-
*Returns:* `find(basic_string
|
| 65 |
|
| 66 |
#### `basic_string::rfind` <a id="string::rfind">[[string::rfind]]</a>
|
| 67 |
|
| 68 |
``` cpp
|
| 69 |
size_type rfind(const basic_string& str,
|
|
@@ -96,14 +96,14 @@ size_type rfind(const charT* s, size_type pos = npos) const;
|
|
| 96 |
elements of `charT`.
|
| 97 |
|
| 98 |
*Returns:* `rfind(basic_string(s), pos)`.
|
| 99 |
|
| 100 |
``` cpp
|
| 101 |
-
size_type rfind(charT c, size_type pos = npos) const
|
| 102 |
```
|
| 103 |
|
| 104 |
-
*Returns:* `rfind(basic_string
|
| 105 |
|
| 106 |
#### `basic_string::find_first_of` <a id="string::find.first.of">[[string::find.first.of]]</a>
|
| 107 |
|
| 108 |
``` cpp
|
| 109 |
size_type
|
|
@@ -138,15 +138,14 @@ size_type find_first_of(const charT* s, size_type pos = 0) const;
|
|
| 138 |
elements of `charT`.
|
| 139 |
|
| 140 |
*Returns:* `find_first_of(basic_string(s), pos)`.
|
| 141 |
|
| 142 |
``` cpp
|
| 143 |
-
size_type find_first_of(charT c, size_type pos = 0) const
|
| 144 |
```
|
| 145 |
|
| 146 |
-
*Returns:*
|
| 147 |
-
`find_first_of(basic_string<charT,traits,Allocator>(1,c), pos)`.
|
| 148 |
|
| 149 |
#### `basic_string::find_last_of` <a id="string::find.last.of">[[string::find.last.of]]</a>
|
| 150 |
|
| 151 |
``` cpp
|
| 152 |
size_type
|
|
@@ -180,15 +179,14 @@ size_type find_last_of(const charT* s, size_type pos = npos) const;
|
|
| 180 |
elements of `charT`.
|
| 181 |
|
| 182 |
*Returns:* `find_last_of(basic_string(s), pos)`.
|
| 183 |
|
| 184 |
``` cpp
|
| 185 |
-
size_type find_last_of(charT c, size_type pos = npos) const
|
| 186 |
```
|
| 187 |
|
| 188 |
-
*Returns:*
|
| 189 |
-
`find_last_of(basic_string<charT,traits,Allocator>(1,c),pos)`.
|
| 190 |
|
| 191 |
#### `basic_string::find_first_not_of` <a id="string::find.first.not.of">[[string::find.first.not.of]]</a>
|
| 192 |
|
| 193 |
``` cpp
|
| 194 |
size_type
|
|
@@ -223,11 +221,11 @@ size_type find_first_not_of(const charT* s, size_type pos = 0) const;
|
|
| 223 |
elements of `charT`.
|
| 224 |
|
| 225 |
*Returns:* `find_first_not_of(basic_string(s), pos)`.
|
| 226 |
|
| 227 |
``` cpp
|
| 228 |
-
size_type find_first_not_of(charT c, size_type pos = 0) const
|
| 229 |
```
|
| 230 |
|
| 231 |
*Returns:* `find_first_not_of(basic_string(1, c), pos)`.
|
| 232 |
|
| 233 |
#### `basic_string::find_last_not_of` <a id="string::find.last.not.of">[[string::find.last.not.of]]</a>
|
|
@@ -265,30 +263,29 @@ size_type find_last_not_of(const charT* s, size_type pos = npos) const;
|
|
| 265 |
elements of `charT`.
|
| 266 |
|
| 267 |
*Returns:* `find_last_not_of(basic_string(s), pos)`.
|
| 268 |
|
| 269 |
``` cpp
|
| 270 |
-
size_type find_last_not_of(charT c, size_type pos = npos) const
|
| 271 |
```
|
| 272 |
|
| 273 |
*Returns:* `find_last_not_of(basic_string(1, c), pos)`.
|
| 274 |
|
| 275 |
#### `basic_string::substr` <a id="string::substr">[[string::substr]]</a>
|
| 276 |
|
| 277 |
``` cpp
|
| 278 |
-
basic_string
|
| 279 |
-
substr(size_type pos = 0, size_type n = npos) const;
|
| 280 |
```
|
| 281 |
|
| 282 |
*Requires:* `pos <= size()`
|
| 283 |
|
| 284 |
*Throws:* `out_of_range` if `pos > size()`.
|
| 285 |
|
| 286 |
*Effects:* Determines the effective length `rlen` of the string to copy
|
| 287 |
as the smaller of `n` and `size() - pos`.
|
| 288 |
|
| 289 |
-
*Returns:* `basic_string
|
| 290 |
|
| 291 |
#### `basic_string::compare` <a id="string::compare">[[string::compare]]</a>
|
| 292 |
|
| 293 |
``` cpp
|
| 294 |
int compare(const basic_string& str) const noexcept;
|
|
@@ -319,11 +316,11 @@ int compare(size_type pos1, size_type n1,
|
|
| 319 |
*Returns:* `basic_string(*this,pos1,n1).compare(str)`.
|
| 320 |
|
| 321 |
``` cpp
|
| 322 |
int compare(size_type pos1, size_type n1,
|
| 323 |
const basic_string& str,
|
| 324 |
-
size_type pos2, size_type n2 ) const;
|
| 325 |
```
|
| 326 |
|
| 327 |
*Returns:*
|
| 328 |
`basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2))`.
|
| 329 |
|
|
|
|
| 8 |
```
|
| 9 |
|
| 10 |
*Returns:* A pointer `p` such that `p + i == &operator[](i)` for each
|
| 11 |
`i` in \[`0`, `size()`\].
|
| 12 |
|
| 13 |
+
*Complexity:* Constant time.
|
| 14 |
|
| 15 |
*Requires:* The program shall not alter any of the values stored in the
|
| 16 |
character array.
|
| 17 |
|
| 18 |
``` cpp
|
|
|
|
| 44 |
|
| 45 |
``` cpp
|
| 46 |
size_type find(const charT* s, size_type pos, size_type n) const;
|
| 47 |
```
|
| 48 |
|
| 49 |
+
*Returns:* `find(basic_string(s,n),pos)`.
|
| 50 |
|
| 51 |
``` cpp
|
| 52 |
+
size_type find(const charT* s, size_type pos = 0) const;
|
| 53 |
```
|
| 54 |
|
| 55 |
*Requires:* `s` points to an array of at least `traits::length(s) + 1`
|
| 56 |
elements of `charT`.
|
| 57 |
|
| 58 |
*Returns:* `find(basic_string(s), pos)`.
|
| 59 |
|
| 60 |
``` cpp
|
| 61 |
+
size_type find(charT c, size_type pos = 0) const;
|
| 62 |
```
|
| 63 |
|
| 64 |
+
*Returns:* `find(basic_string(1,c), pos)`.
|
| 65 |
|
| 66 |
#### `basic_string::rfind` <a id="string::rfind">[[string::rfind]]</a>
|
| 67 |
|
| 68 |
``` cpp
|
| 69 |
size_type rfind(const basic_string& str,
|
|
|
|
| 96 |
elements of `charT`.
|
| 97 |
|
| 98 |
*Returns:* `rfind(basic_string(s), pos)`.
|
| 99 |
|
| 100 |
``` cpp
|
| 101 |
+
size_type rfind(charT c, size_type pos = npos) const;
|
| 102 |
```
|
| 103 |
|
| 104 |
+
*Returns:* `rfind(basic_string(1,c),pos)`.
|
| 105 |
|
| 106 |
#### `basic_string::find_first_of` <a id="string::find.first.of">[[string::find.first.of]]</a>
|
| 107 |
|
| 108 |
``` cpp
|
| 109 |
size_type
|
|
|
|
| 138 |
elements of `charT`.
|
| 139 |
|
| 140 |
*Returns:* `find_first_of(basic_string(s), pos)`.
|
| 141 |
|
| 142 |
``` cpp
|
| 143 |
+
size_type find_first_of(charT c, size_type pos = 0) const;
|
| 144 |
```
|
| 145 |
|
| 146 |
+
*Returns:* `find_first_of(basic_string(1,c), pos)`.
|
|
|
|
| 147 |
|
| 148 |
#### `basic_string::find_last_of` <a id="string::find.last.of">[[string::find.last.of]]</a>
|
| 149 |
|
| 150 |
``` cpp
|
| 151 |
size_type
|
|
|
|
| 179 |
elements of `charT`.
|
| 180 |
|
| 181 |
*Returns:* `find_last_of(basic_string(s), pos)`.
|
| 182 |
|
| 183 |
``` cpp
|
| 184 |
+
size_type find_last_of(charT c, size_type pos = npos) const;
|
| 185 |
```
|
| 186 |
|
| 187 |
+
*Returns:* `find_last_of(basic_string(1,c),pos)`.
|
|
|
|
| 188 |
|
| 189 |
#### `basic_string::find_first_not_of` <a id="string::find.first.not.of">[[string::find.first.not.of]]</a>
|
| 190 |
|
| 191 |
``` cpp
|
| 192 |
size_type
|
|
|
|
| 221 |
elements of `charT`.
|
| 222 |
|
| 223 |
*Returns:* `find_first_not_of(basic_string(s), pos)`.
|
| 224 |
|
| 225 |
``` cpp
|
| 226 |
+
size_type find_first_not_of(charT c, size_type pos = 0) const;
|
| 227 |
```
|
| 228 |
|
| 229 |
*Returns:* `find_first_not_of(basic_string(1, c), pos)`.
|
| 230 |
|
| 231 |
#### `basic_string::find_last_not_of` <a id="string::find.last.not.of">[[string::find.last.not.of]]</a>
|
|
|
|
| 263 |
elements of `charT`.
|
| 264 |
|
| 265 |
*Returns:* `find_last_not_of(basic_string(s), pos)`.
|
| 266 |
|
| 267 |
``` cpp
|
| 268 |
+
size_type find_last_not_of(charT c, size_type pos = npos) const;
|
| 269 |
```
|
| 270 |
|
| 271 |
*Returns:* `find_last_not_of(basic_string(1, c), pos)`.
|
| 272 |
|
| 273 |
#### `basic_string::substr` <a id="string::substr">[[string::substr]]</a>
|
| 274 |
|
| 275 |
``` cpp
|
| 276 |
+
basic_string substr(size_type pos = 0, size_type n = npos) const;
|
|
|
|
| 277 |
```
|
| 278 |
|
| 279 |
*Requires:* `pos <= size()`
|
| 280 |
|
| 281 |
*Throws:* `out_of_range` if `pos > size()`.
|
| 282 |
|
| 283 |
*Effects:* Determines the effective length `rlen` of the string to copy
|
| 284 |
as the smaller of `n` and `size() - pos`.
|
| 285 |
|
| 286 |
+
*Returns:* `basic_string(data()+pos,rlen)`.
|
| 287 |
|
| 288 |
#### `basic_string::compare` <a id="string::compare">[[string::compare]]</a>
|
| 289 |
|
| 290 |
``` cpp
|
| 291 |
int compare(const basic_string& str) const noexcept;
|
|
|
|
| 316 |
*Returns:* `basic_string(*this,pos1,n1).compare(str)`.
|
| 317 |
|
| 318 |
``` cpp
|
| 319 |
int compare(size_type pos1, size_type n1,
|
| 320 |
const basic_string& str,
|
| 321 |
+
size_type pos2, size_type n2 = npos) const;
|
| 322 |
```
|
| 323 |
|
| 324 |
*Returns:*
|
| 325 |
`basic_string(*this, pos1, n1).compare(basic_string(str, pos2, n2))`.
|
| 326 |
|