From Jason Turner

[string::erase]

Diff to HTML by rtfpessoa

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