| Index: base/memory/scoped_vector.h
|
| diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h
|
| index ebc2617cfb2f456ad4e0f14c8272c21e2866a4b7..a320b1e5d1f0668f06dae7d8b40913e21939cac7 100644
|
| --- a/base/memory/scoped_vector.h
|
| +++ b/base/memory/scoped_vector.h
|
| @@ -12,7 +12,6 @@
|
|
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| -#include "base/stl_util.h"
|
|
|
| // ScopedVector wraps a vector deleting the elements from its
|
| // destructor.
|
| @@ -88,8 +87,10 @@ class ScopedVector {
|
|
|
| // Resize, deleting elements in the disappearing range if we are shrinking.
|
| void resize(size_t new_size) {
|
| - if (v_.size() > new_size)
|
| - base::STLDeleteContainerPointers(v_.begin() + new_size, v_.end());
|
| + if (v_.size() > new_size) {
|
| + for (auto it = v_.begin() + new_size; it != v_.end(); ++it)
|
| + delete *it;
|
| + }
|
| v_.resize(new_size);
|
| }
|
|
|
| @@ -98,7 +99,11 @@ class ScopedVector {
|
| v_.assign(begin, end);
|
| }
|
|
|
| - void clear() { base::STLDeleteElements(&v_); }
|
| + void clear() {
|
| + for (auto* item : *this)
|
| + delete item;
|
| + v_.clear();
|
| + }
|
|
|
| // Like |clear()|, but doesn't delete any elements.
|
| void weak_clear() { v_.clear(); }
|
| @@ -124,7 +129,8 @@ class ScopedVector {
|
| }
|
|
|
| iterator erase(iterator first, iterator last) {
|
| - base::STLDeleteContainerPointers(first, last);
|
| + for (auto it = first; it != last; ++it)
|
| + delete *it;
|
| return v_.erase(first, last);
|
| }
|
|
|
|
|