Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: base/memory/scoped_vector.h

Issue 7342047: Cleanup base/stl_util (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed unneeded include + rebase Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/stl_util-inl.h" 12 #include "base/stl_util.h"
13 13
14 // ScopedVector wraps a vector deleting the elements from its 14 // ScopedVector wraps a vector deleting the elements from its
15 // destructor. 15 // destructor.
16 template <class T> 16 template <class T>
17 class ScopedVector { 17 class ScopedVector {
18 public: 18 public:
19 typedef typename std::vector<T*>::iterator iterator; 19 typedef typename std::vector<T*>::iterator iterator;
20 typedef typename std::vector<T*>::const_iterator const_iterator; 20 typedef typename std::vector<T*>::const_iterator const_iterator;
21 typedef typename std::vector<T*>::reverse_iterator reverse_iterator; 21 typedef typename std::vector<T*>::reverse_iterator reverse_iterator;
22 typedef typename std::vector<T*>::const_reverse_iterator 22 typedef typename std::vector<T*>::const_reverse_iterator
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 iterator weak_erase(iterator first, iterator last) { 87 iterator weak_erase(iterator first, iterator last) {
88 return v.erase(first, last); 88 return v.erase(first, last);
89 } 89 }
90 private: 90 private:
91 std::vector<T*> v; 91 std::vector<T*> v;
92 92
93 DISALLOW_COPY_AND_ASSIGN(ScopedVector); 93 DISALLOW_COPY_AND_ASSIGN(ScopedVector);
94 }; 94 };
95 95
96 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ 96 #endif // BASE_MEMORY_SCOPED_VECTOR_H_
OLDNEW
« no previous file with comments | « base/files/file_path_watcher_browsertest.cc ('k') | base/stl_util.h » ('j') | base/stl_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698