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

Side by Side Diff: base/scoped_vector.h

Issue 107001: Move scoped_vector.h and stl_util-inl.h to base/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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
« no previous file with comments | « base/base.gyp ('k') | base/stl_util-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_COMMON_SCOPED_VECTOR_H__ 5 #ifndef BASE_SCOPED_VECTOR_H_
6 #define CHROME_BROWSER_COMMON_SCOPED_VECTOR_H__ 6 #define BASE_SCOPED_VECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "chrome/common/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
11 11
12 // ScopedVector wraps a vector deleting the elements from its 12 // ScopedVector wraps a vector deleting the elements from its
13 // destructor. 13 // destructor.
14 template <class T> 14 template <class T>
15 class ScopedVector { 15 class ScopedVector {
16 public: 16 public:
17 typedef typename std::vector<T*>::iterator iterator; 17 typedef typename std::vector<T*>::iterator iterator;
18 typedef typename std::vector<T*>::const_iterator const_iterator; 18 typedef typename std::vector<T*>::const_iterator const_iterator;
19 19
20 ScopedVector() {} 20 ScopedVector() {}
(...skipping 20 matching lines...) Expand all
41 void release(std::vector<T*>* out) { out->swap(v); v.clear(); } 41 void release(std::vector<T*>* out) { out->swap(v); v.clear(); }
42 42
43 void reset() { STLDeleteElements(&v); } 43 void reset() { STLDeleteElements(&v); }
44 44
45 private: 45 private:
46 std::vector<T*> v; 46 std::vector<T*> v;
47 47
48 DISALLOW_EVIL_CONSTRUCTORS(ScopedVector); 48 DISALLOW_EVIL_CONSTRUCTORS(ScopedVector);
49 }; 49 };
50 50
51 #endif // CHROME_BROWSER_COMMON_SCOPED_VECTOR_H__ 51 #endif // BASE_SCOPED_VECTOR_H_
OLDNEW
« no previous file with comments | « base/base.gyp ('k') | base/stl_util-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698