| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_MEMORY_SCOPED_VECTOR_H_ | 5 #ifndef BASE_MEMORY_SCOPED_VECTOR_H_ |
| 6 #define BASE_MEMORY_SCOPED_VECTOR_H_ | 6 #define BASE_MEMORY_SCOPED_VECTOR_H_ |
| 7 | 7 |
| 8 #include <stddef.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/logging.h" | 12 #include "base/logging.h" |
| 12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/move.h" | 14 #include "base/move.h" |
| 14 #include "base/stl_util.h" | 15 #include "base/stl_util.h" |
| 15 | 16 |
| 16 // ScopedVector wraps a vector deleting the elements from its | 17 // ScopedVector wraps a vector deleting the elements from its |
| 17 // destructor. | 18 // destructor. |
| 18 // | 19 // |
| 19 // TODO(http://crbug.com/554289): DEPRECATED: Use std::vector instead (now that | 20 // TODO(http://crbug.com/554289): DEPRECATED: Use std::vector instead (now that |
| 20 // we have support for moveable types inside containers). | 21 // we have support for moveable types inside containers). |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 // Like |erase()|, but doesn't delete the elements in [first, last). | 138 // Like |erase()|, but doesn't delete the elements in [first, last). |
| 138 iterator weak_erase(iterator first, iterator last) { | 139 iterator weak_erase(iterator first, iterator last) { |
| 139 return v_.erase(first, last); | 140 return v_.erase(first, last); |
| 140 } | 141 } |
| 141 | 142 |
| 142 private: | 143 private: |
| 143 std::vector<T*> v_; | 144 std::vector<T*> v_; |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ | 147 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ |
| OLD | NEW |