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

Unified Diff: base/memory/scoped_vector.h

Issue 10669038: base: Remove dereference structure operator (i.e ->) from ScopedVector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/scoped_vector.h
diff --git a/base/memory/scoped_vector.h b/base/memory/scoped_vector.h
index dc500819b38c19e1673c09373bf6be3b7152e1ad..69931c85b6f4b82d94d99a57c32ce5c814f12418 100644
--- a/base/memory/scoped_vector.h
+++ b/base/memory/scoped_vector.h
@@ -42,8 +42,6 @@ class ScopedVector {
return *this;
}
- std::vector<T*>* operator->() { return &v; }
- const std::vector<T*>* operator->() const { return &v; }
T*& operator[](size_t i) { return v[i]; }
const T* operator[](size_t i) const { return v[i]; }
@@ -69,6 +67,7 @@ class ScopedVector {
std::vector<T*>& get() { return v; }
const std::vector<T*>& get() const { return v; }
+ void swap(std::vector<T*>& other) { v.swap(other); }
void swap(ScopedVector<T>& other) { v.swap(other.v); }
void release(std::vector<T*>* out) {
out->swap(v);
@@ -79,6 +78,13 @@ class ScopedVector {
void reserve(size_t capacity) { v.reserve(capacity); }
void resize(size_t new_size) { v.resize(new_size); }
+ template<typename InputIterator>
+ void assign(InputIterator begin, InputIterator end) {
+ v.assign(begin, end);
+ }
+
+ void clear() { v.clear(); }
+
// Lets the ScopedVector take ownership of |x|.
iterator insert(iterator position, T* x) {
return v.insert(position, x);
@@ -109,6 +115,7 @@ class ScopedVector {
iterator weak_erase(iterator first, iterator last) {
return v.erase(first, last);
}
+
private:
std::vector<T*> v;
};
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698