From Jason Turner

[string::erase]

Diff to HTML by rtfpessoa

tmp/tmpa42jlumu/{from.md → to.md} RENAMED
@@ -1,10 +1,9 @@
1
  #### `basic_string::erase` <a id="string::erase">[[string::erase]]</a>
2
 
3
  ``` cpp
4
- basic_string<charT,traits,Allocator>&
5
- erase(size_type pos = 0, size_type n = npos);
6
  ```
7
 
8
  *Requires:* `pos` ` <= size()`
9
 
10
  *Throws:* `out_of_range` if `pos` `> size()`.
@@ -22,10 +21,12 @@ string controlled by `*this` beginning at position `pos + xlen`.
22
 
23
  ``` cpp
24
  iterator erase(const_iterator p);
25
  ```
26
 
 
 
27
  *Effects:* removes the character referred to by `p`.
28
 
29
  *Returns:* An iterator which points to the element immediately following
30
  `p` prior to the element being erased. If no such element exists,
31
  `end()` is returned.
@@ -35,10 +36,12 @@ iterator erase(const_iterator first, const_iterator last);
35
  ```
36
 
37
  *Requires:* `first` and `last` are valid iterators on `*this`, defining
38
  a range `[first,last)`.
39
 
 
 
40
  *Effects:* removes the characters in the range `[first,last)`.
41
 
42
  *Returns:* An iterator which points to the element pointed to by `last`
43
  prior to the other elements being erased. If no such element exists,
44
  `end()` is returned.
@@ -47,7 +50,9 @@ prior to the other elements being erased. If no such element exists,
47
  void pop_back();
48
  ```
49
 
50
  *Requires:* `!empty()`
51
 
 
 
52
  *Effects:* Equivalent to `erase(size() - 1, 1)`.
53
 
 
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()`.
 
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.
 
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.
 
50
  void pop_back();
51
  ```
52
 
53
  *Requires:* `!empty()`
54
 
55
+ *Throws:* Nothing.
56
+
57
  *Effects:* Equivalent to `erase(size() - 1, 1)`.
58