commit | 91fcb3ed58845ddd5afa98a7150f3024d87c7425 | [log] [tgz] |
---|---|---|
author | halcanary <halcanary@google.com> | Fri Mar 04 13:53:22 2016 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Fri Mar 04 13:53:22 2016 -0800 |
tree | 8fc901cfd4729792c7282683e2ade2db5195e291 | |
parent | 41dc3d63a587b6bf4e437ac114485e62c42abe41 [diff] [blame] |
SkPDF: PDFDevice use SkTArray<T> rather than SkTDArray<T*> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1767713002 Review URL: https://codereview.chromium.org/1767713002
diff --git a/include/private/SkTArray.h b/include/private/SkTArray.h index 5330e49..8577200 100644 --- a/include/private/SkTArray.h +++ b/include/private/SkTArray.h
@@ -156,6 +156,15 @@ } /** + * 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) {