tmp/tmptl_v1xnu/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### `basic_string::erase` <a id="string.erase">[[string.erase]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
basic_string& erase(size_type pos = 0, size_type n = npos);
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Throws:* `out_of_range` if `pos` `> size()`.
|
| 8 |
+
|
| 9 |
+
*Effects:* Determines the effective length `xlen` of the string to be
|
| 10 |
+
removed as the smaller of `n` and `size() - pos`.
|
| 11 |
+
|
| 12 |
+
The function then replaces the string controlled by `*this` with a
|
| 13 |
+
string of length `size() - xlen` whose first `pos` elements are a copy
|
| 14 |
+
of the initial elements of the original string controlled by `*this`,
|
| 15 |
+
and whose remaining elements are a copy of the elements of the original
|
| 16 |
+
string controlled by `*this` beginning at position `pos + xlen`.
|
| 17 |
+
|
| 18 |
+
*Returns:* `*this`.
|
| 19 |
+
|
| 20 |
+
``` cpp
|
| 21 |
+
iterator erase(const_iterator p);
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
*Throws:* Nothing.
|
| 25 |
+
|
| 26 |
+
*Effects:* Removes the character referred to by `p`.
|
| 27 |
+
|
| 28 |
+
*Returns:* An iterator which points to the element immediately following
|
| 29 |
+
`p` prior to the element being erased. If no such element exists,
|
| 30 |
+
`end()` is returned.
|
| 31 |
+
|
| 32 |
+
``` cpp
|
| 33 |
+
iterator erase(const_iterator first, const_iterator last);
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
*Requires:* `first` and `last` are valid iterators on `*this`, defining
|
| 37 |
+
a range `[first, last)`.
|
| 38 |
+
|
| 39 |
+
*Throws:* Nothing.
|
| 40 |
+
|
| 41 |
+
*Effects:* Removes the characters in the range `[first, last)`.
|
| 42 |
+
|
| 43 |
+
*Returns:* An iterator which points to the element pointed to by `last`
|
| 44 |
+
prior to the other elements being erased. If no such element exists,
|
| 45 |
+
`end()` is returned.
|
| 46 |
+
|
| 47 |
+
``` cpp
|
| 48 |
+
void pop_back();
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
*Requires:* `!empty()`.
|
| 52 |
+
|
| 53 |
+
*Throws:* Nothing.
|
| 54 |
+
|
| 55 |
+
*Effects:* Equivalent to `erase(size() - 1, 1)`.
|
| 56 |
+
|