Chromium Code Reviews| Index: cc/quads/list_container.h |
| diff --git a/cc/quads/list_container.h b/cc/quads/list_container.h |
| index dd313fc8b45bc67d1b7568bea2dd0d0fe81e6a14..94754aba81aab855041776c761cdb1d1dc0adb73 100644 |
| --- a/cc/quads/list_container.h |
| +++ b/cc/quads/list_container.h |
| @@ -209,6 +209,12 @@ class CC_EXPORT ListContainer { |
| return new (Allocate(sizeof(DerivedElementType))) |
| DerivedElementType(*source); |
| } |
| + // Construct a new element on top of an existing one. |
| + template <typename DerivedElementType> |
| + DerivedElementType* ReplaceExistingElement(Iterator at) { |
|
danakj
2015/03/24 17:55:15
Can you add unit tests for this method?
achaulk
2015/03/27 17:17:47
Done.
|
| + at->~BaseElementType(); |
| + return new (*at) DerivedElementType(); |
| + } |
| size_t size() const; |
| bool empty() const; |