Index: third_party/WebKit/Source/platform/graphics/ContiguousContainer.h |
diff --git a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h |
index 98bce1957c4aa2692f746cff3ceb33aaef9a4653..dc5210f5ccc7661a8ef48ac7ee208be57a08ac88 100644 |
--- a/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h |
+++ b/third_party/WebKit/Source/platform/graphics/ContiguousContainer.h |
@@ -192,14 +192,15 @@ public: |
void swap(ContiguousContainer& other) { ContiguousContainerBase::swap(other); } |
- // Appends a new element using memcpy, then default-constructs a base |
- // element in its place. Use with care. |
- BaseElementType& appendByMoving(BaseElementType& item, size_t size) |
+ // Appends a new element using memcpy, then constructs a base element in its place with args. |
+ // Use with care. |
+ template <typename... Args> |
+ BaseElementType& appendByMoving(BaseElementType& item, size_t size, Args&&... args) |
{ |
ASSERT(size >= sizeof(BaseElementType)); |
void* newItem = alignedAllocate(size); |
memcpy(newItem, static_cast<void*>(&item), size); |
- new (&item) BaseElementType; |
+ new (&item) BaseElementType(std::forward<Args>(args)...); |
return *static_cast<BaseElementType*>(newItem); |
} |