mtklein | 1138be4 | 2016-01-24 19:49:24 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | #include "Test.h" |
| 8 | #include "SkTemplates.h" |
| 9 | #include <utility> |
| 10 | |
| 11 | namespace { |
| 12 | class Moveable { |
| 13 | public: |
| 14 | Moveable() {} |
| 15 | Moveable(Moveable&&) {} |
| 16 | Moveable& operator=(Moveable&&) { return *this; } |
| 17 | private: |
| 18 | Moveable(const Moveable&); |
| 19 | Moveable& operator=(const Moveable&); |
| 20 | }; |
| 21 | template <typename T> void deleter(T*) { } |
| 22 | template <typename T> struct Deleter { |
| 23 | void operator()(T* t) { delete static_cast<const Moveable*>(t); } |
| 24 | }; |
| 25 | } // namespace |
| 26 | |
| 27 | DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) { |
| 28 | Moveable src1; Moveable dst1(std::move(src1)); |
| 29 | Moveable src2, dst2; dst2 = std::move(src2); |
| 30 | } |