Chromium Code Reviews| Index: include/private/SkTArray.h |
| diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h |
| index 5330e4930725cf5bbf5945e66cf847da68d09fba..0181bb4f01adfd069da2196431f0c784e1201af3 100644 |
| --- a/include/private/SkTArray.h |
| +++ b/include/private/SkTArray.h |
| @@ -147,6 +147,15 @@ public: |
| } |
| /** |
| + * Version of above that uses a move constructor to initialize the new item |
|
bungeman-skia
2016/03/04 19:36:33
This says 'above' but the copy push_back is below.
|
| + */ |
| + T& push_back(T&& t) { |
| + T* newT = reinterpret_cast<T*>(this->push_back_raw(1)); |
| + new (newT) T(std::move(t)); |
| + return *newT; |
| + } |
| + |
| + /** |
| * Version of above that uses a copy constructor to initialize the new item |
| */ |
| T& push_back(const T& t) { |