diff options
author | Chris Blume <cblume@google.com> | 2017-04-25 17:33:13 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-26 01:24:24 +0000 |
commit | 2b6be207a1b4595646950324ab1ccf0e3b9f73ac (patch) | |
tree | 6ee7055940faefc3736737db29152c24901e2160 /tests | |
parent | 101806f4526d0ba5d48515c82a28dbf6956aca4d (diff) |
Make SkNoncopyable movable
SkNoncopyable declares (but does not define) its copy constructor and
copy assignment operator. These are also private so the error for misuse
happens at compile-time instead of link-time.
However, this seems to be from before C++11.
Because other constructors were declared, the compiler does not generate
a move constructor or a move assignment operator. The result of this is
perfectly legal non-copying scenarios are also accidentally blocked. An
example of this is returning the non-copyable type. The object being
returned is a candidate for a move, since it is about to be destroyed.
And in C++17 copy elision is actually guaranteed.
Change-Id: Ia31be9091c644f31a45dd18216330a68be3cf456
Reviewed-on: https://skia-review.googlesource.com/14294
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions