tmp/tmph_lqw93k/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Erasure <a id="multimap.erasure">[[multimap.erasure]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
template<class Key, class T, class Compare, class Allocator, class Predicate>
|
| 5 |
+
typename multimap<Key, T, Compare, Allocator>::size_type
|
| 6 |
+
erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred);
|
| 7 |
+
```
|
| 8 |
+
|
| 9 |
+
*Effects:* Equivalent to:
|
| 10 |
+
|
| 11 |
+
``` cpp
|
| 12 |
+
auto original_size = c.size();
|
| 13 |
+
for (auto i = c.begin(), last = c.end(); i != last; ) {
|
| 14 |
+
if (pred(*i)) {
|
| 15 |
+
i = c.erase(i);
|
| 16 |
+
} else {
|
| 17 |
+
++i;
|
| 18 |
+
}
|
| 19 |
+
}
|
| 20 |
+
return original_size - c.size();
|
| 21 |
+
```
|
| 22 |
+
|