| Index: cc/quads/list_container.h
|
| diff --git a/cc/quads/list_container.h b/cc/quads/list_container.h
|
| index 34a30aadd6e74c2403fce5d339d61b9f00c428e6..6c559f611e92379ecc4a151d5226bc849990f6a7 100644
|
| --- a/cc/quads/list_container.h
|
| +++ b/cc/quads/list_container.h
|
| @@ -146,13 +146,21 @@ class CC_EXPORT ListContainer {
|
| const BaseElementType* front() const;
|
| const BaseElementType* back() const;
|
|
|
| + BaseElementType* ElementAt(size_t index);
|
| + const BaseElementType* ElementAt(size_t index) const;
|
| +
|
| // Take in derived element type and construct it at location generated by
|
| // Allocate().
|
| template <typename DerivedElementType>
|
| DerivedElementType* AllocateAndConstruct() {
|
| - DerivedElementType* result =
|
| - new (Allocate(sizeof(DerivedElementType))) DerivedElementType;
|
| - return result;
|
| + return new (Allocate(sizeof(DerivedElementType))) DerivedElementType;
|
| + }
|
| + // Take in derived element type and copy construct it at location generated by
|
| + // Allocate().
|
| + template <typename DerivedElementType>
|
| + DerivedElementType* AllocateAndCopyFrom(const DerivedElementType* source) {
|
| + return new (Allocate(sizeof(DerivedElementType)))
|
| + DerivedElementType(*source);
|
| }
|
|
|
| size_t size() const;
|
|
|