Index: include/private/SkTArray.h |
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h |
index 5330e4930725cf5bbf5945e66cf847da68d09fba..8577200770dbcf43eb6cc0dbf2f48f97d8cb1876 100644 |
--- a/include/private/SkTArray.h |
+++ b/include/private/SkTArray.h |
@@ -156,6 +156,15 @@ public: |
} |
/** |
+ * Version of above that uses a move constructor to initialize the new item |
+ */ |
+ T& push_back(T&& t) { |
+ T* newT = reinterpret_cast<T*>(this->push_back_raw(1)); |
+ new (newT) T(std::move(t)); |
+ return *newT; |
+ } |
+ |
+ /** |
* Construct a new T at the back of this array. |
*/ |
template<class... Args> T& emplace_back(Args&&... args) { |