Chromium Code Reviews| Index: cc/base/list_container.h |
| diff --git a/cc/base/list_container.h b/cc/base/list_container.h |
| index 04c7f14a0322bcc03b99d761540f401742beab7a..d79fd29583287318656f04b8b6fd6c43aa4f408c 100644 |
| --- a/cc/base/list_container.h |
| +++ b/cc/base/list_container.h |
| @@ -27,6 +27,10 @@ namespace cc { |
| template <class BaseElementType> |
| class ListContainer { |
| public: |
| + ListContainer(ListContainer<BaseElementType>&& other) { |
| + helper_.data_.swap(other.helper_.data_); |
| + } |
| + |
| // BaseElementType is the type of raw pointers this class hands out; however, |
| // its derived classes might require different memory sizes. |
| // max_size_for_derived_class the largest memory size required for all the |
| @@ -144,6 +148,12 @@ class ListContainer { |
| return result; |
| } |
| + ListContainer<BaseElementType>& operator=( |
|
dcheng
2016/06/15 12:27:19
<BaseElementType> shouldn't be needed here.
Fady Samuel
2016/06/15 14:46:25
Done. Also turns out I don't need the move constru
|
| + ListContainer<BaseElementType>&& other) { |
| + helper_.data_.swap(other.helper_.data_); |
| + return *this; |
| + } |
| + |
| template <typename DerivedElementType> |
| void swap(ListContainer<DerivedElementType>& other) { |
| helper_.data_.swap(other.helper_.data_); |