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

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

Issue 9195035: remove ; which breaks nacl_integration since they use -pedantic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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/memory/scoped_ptr.h ('k') | no next file » | 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) 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 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/move.h" 12 #include "base/move.h"
13 #include "base/stl_util.h" 13 #include "base/stl_util.h"
14 14
15 // ScopedVector wraps a vector deleting the elements from its 15 // ScopedVector wraps a vector deleting the elements from its
16 // destructor. 16 // destructor.
17 template <class T> 17 template <class T>
18 class ScopedVector { 18 class ScopedVector {
19 MOVE_ONLY_TYPE_FOR_CPP_03(ScopedVector, RValue); 19 MOVE_ONLY_TYPE_FOR_CPP_03(ScopedVector, RValue)
20 20
21 public: 21 public:
22 typedef typename std::vector<T*>::iterator iterator; 22 typedef typename std::vector<T*>::iterator iterator;
23 typedef typename std::vector<T*>::const_iterator const_iterator; 23 typedef typename std::vector<T*>::const_iterator const_iterator;
24 typedef typename std::vector<T*>::reverse_iterator reverse_iterator; 24 typedef typename std::vector<T*>::reverse_iterator reverse_iterator;
25 typedef typename std::vector<T*>::const_reverse_iterator 25 typedef typename std::vector<T*>::const_reverse_iterator
26 const_reverse_iterator; 26 const_reverse_iterator;
27 27
28 ScopedVector() {} 28 ScopedVector() {}
29 ~ScopedVector() { reset(); } 29 ~ScopedVector() { reset(); }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // Like |erase()|, but doesn't delete the elements in [first, last). 95 // Like |erase()|, but doesn't delete the elements in [first, last).
96 iterator weak_erase(iterator first, iterator last) { 96 iterator weak_erase(iterator first, iterator last) {
97 return v.erase(first, last); 97 return v.erase(first, last);
98 } 98 }
99 private: 99 private:
100 std::vector<T*> v; 100 std::vector<T*> v;
101 }; 101 };
102 102
103 #endif // BASE_MEMORY_SCOPED_VECTOR_H_ 103 #endif // BASE_MEMORY_SCOPED_VECTOR_H_
OLDNEW
« no previous file with comments | « base/memory/scoped_ptr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698