Index: cc/base/scoped_ptr_vector.h |
diff --git a/cc/base/scoped_ptr_vector.h b/cc/base/scoped_ptr_vector.h |
index 01f4d3d0fc4ed795eeee78feab7d35839e009d85..8cd368d885ce3f72a2b962c06b2958fa4ba05dec 100644 |
--- a/cc/base/scoped_ptr_vector.h |
+++ b/cc/base/scoped_ptr_vector.h |
@@ -33,7 +33,7 @@ class ScopedPtrVector { |
// to methods on the ScopedPtrVector class to appear in the vector. |
class iterator : public std::vector<T*>::iterator { |
public: |
- iterator(const typename std::vector<T*>::iterator& other) |
+ iterator(const typename std::vector<T*>::iterator& other) // NOLINT |
: std::vector<T*>::iterator(other) {} |
T* const& operator*() { return std::vector<T*>::iterator::operator*(); } |
}; |
@@ -129,6 +129,17 @@ class ScopedPtrVector { |
data_.insert(position, item.release()); |
} |
+ void insert_and_take(iterator position, |
+ ScopedPtrVector<T>& other) { |
+ std::vector<T*> tmp_data; |
+ for (ScopedPtrVector<T>::iterator it = other.begin(); |
+ it != other.end(); |
+ ++it) { |
+ tmp_data.push_back(other.take(it).release()); |
+ } |
+ data_.insert(position, tmp_data.begin(), tmp_data.end()); |
+ } |
+ |
void swap(ScopedPtrVector<T>& other) { |
data_.swap(other.data_); |
} |