mirror of
https://abf.rosa.ru/djam/chromium-browser-stable-test.git
synced 2025-02-24 10:02:47 +00:00
30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
![]() |
--- chromium-83.0.4103.97/base/stl_util.h.orig
|
||
|
+++ chromium-83.0.4103.97/base/stl_util.h
|
||
|
@@ -579,19 +579,19 @@
|
||
|
return old_size - std::distance(container.begin(), container.end());
|
||
|
}
|
||
|
|
||
|
+template <class T, class Allocator, class Predicate>
|
||
|
+size_t EraseIf(std::list<T, Allocator>& container, Predicate pred) {
|
||
|
+ size_t old_size = container.size();
|
||
|
+ container.remove_if(pred);
|
||
|
+ return old_size - container.size();
|
||
|
+}
|
||
|
+
|
||
|
template <class T, class Allocator, class Value>
|
||
|
size_t Erase(std::list<T, Allocator>& container, const Value& value) {
|
||
|
// Unlike std::list::remove, this function template accepts heterogeneous
|
||
|
// types and does not force a conversion to the container's value type before
|
||
|
// invoking the == operator.
|
||
|
return EraseIf(container, [&](const T& cur) { return cur == value; });
|
||
|
-}
|
||
|
-
|
||
|
-template <class T, class Allocator, class Predicate>
|
||
|
-size_t EraseIf(std::list<T, Allocator>& container, Predicate pred) {
|
||
|
- size_t old_size = container.size();
|
||
|
- container.remove_if(pred);
|
||
|
- return old_size - container.size();
|
||
|
}
|
||
|
|
||
|
template <class Key, class T, class Compare, class Allocator, class Predicate>
|