From Jason Turner

[deque.erasure]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpbus64bqz/{from.md → to.md} +32 -0
tmp/tmpbus64bqz/{from.md → to.md} RENAMED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Erasure <a id="deque.erasure">[[deque.erasure]]</a>
2
+
3
+ ``` cpp
4
+ template<class T, class Allocator, class U>
5
+ typename deque<T, Allocator>::size_type
6
+ erase(deque<T, Allocator>& c, const U& value);
7
+ ```
8
+
9
+ *Effects:* Equivalent to:
10
+
11
+ ``` cpp
12
+ auto it = remove(c.begin(), c.end(), value);
13
+ auto r = distance(it, c.end());
14
+ c.erase(it, c.end());
15
+ return r;
16
+ ```
17
+
18
+ ``` cpp
19
+ template<class T, class Allocator, class Predicate>
20
+ typename deque<T, Allocator>::size_type
21
+ erase_if(deque<T, Allocator>& c, Predicate pred);
22
+ ```
23
+
24
+ *Effects:* Equivalent to:
25
+
26
+ ``` cpp
27
+ auto it = remove_if(c.begin(), c.end(), pred);
28
+ auto r = distance(it, c.end());
29
+ c.erase(it, c.end());
30
+ return r;
31
+ ```
32
+