| 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 #pragma once | |
| 8 | 7 |
| 9 #include <vector> | 8 #include <vector> |
| 10 | 9 |
| 11 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 12 #include "base/move.h" | 11 #include "base/move.h" |
| 13 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 14 | 13 |
| 15 // ScopedVector wraps a vector deleting the elements from its | 14 // ScopedVector wraps a vector deleting the elements from its |
| 16 // destructor. | 15 // destructor. |
| 17 template <class T> | 16 template <class T> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 // Like |erase()|, but doesn't delete the elements in [first, last). | 113 // Like |erase()|, but doesn't delete the elements in [first, last). |
| 115 iterator weak_erase(iterator first, iterator last) { | 114 iterator weak_erase(iterator first, iterator last) { |
| 116 return v.erase(first, last); | 115 return v.erase(first, last); |
| 117 } | 116 } |
| 118 | 117 |
| 119 private: | 118 private: |
| 120 std::vector<T*> v; | 119 std::vector<T*> v; |
| 121 }; | 120 }; |
| 122 | 121 |
| 123 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ | 122 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ |
| OLD | NEW |