From db402cab8b23f2f912f880af8be9f51605ad2bc7 Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Tue, 13 Dec 2016 12:46:05 -0500 Subject: add move semantics to SkTHash* The more I look at std::unordered_map and co., the less I like them. I think we might want to bet on SkTHash*. As a simple first improvement, add move support. Next comes shrinking, and then I'll start moving over SkTDynamicHash users. BUG=skia:6053 Change-Id: Ifdb5d713aab66434ca271c7f18a0cbbb0720099c Reviewed-on: https://skia-review.googlesource.com/5943 Commit-Queue: Mike Klein Reviewed-by: Herb Derby Reviewed-by: Hal Canary --- tests/HashTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/HashTest.cpp') diff --git a/tests/HashTest.cpp b/tests/HashTest.cpp index c9b1bc967b..4a884e3b5b 100644 --- a/tests/HashTest.cpp +++ b/tests/HashTest.cpp @@ -111,6 +111,13 @@ public: *fCounter += 1; } + CopyCounter(CopyCounter&& other) { *this = std::move(other); } + void operator=(CopyCounter&& other) { + fID = other.fID; + fCounter = other.fCounter; + } + + bool operator==(const CopyCounter& other) const { return fID == other.fID; } -- cgit v1.2.3