blob: f7d194a450e1269fb5bba482f1dd77178e9b9f10 [file] [log] [blame]
halcanary3a6672a2015-02-13 15:12:52 -08001/*
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"
bungemana3434d82015-09-07 12:45:52 -07008#include "SkTemplates.h"
halcanary3a6672a2015-02-13 15:12:52 -08009
10namespace {
halcanary3a6672a2015-02-13 15:12:52 -080011class Moveable {
12public:
13 Moveable() {}
14 Moveable(Moveable&&) {}
15 Moveable& operator=(Moveable&&) { return *this; }
16private:
17 Moveable(const Moveable&);
18 Moveable& operator=(const Moveable&);
19};
bungemana3434d82015-09-07 12:45:52 -070020template <typename T> void deleter(T*) { }
21template <typename T> struct Deleter {
22 void operator()(T* t) { delete static_cast<const Moveable*>(t); }
23};
halcanary3a6672a2015-02-13 15:12:52 -080024} // namespace
25
26DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) {
bungemana3434d82015-09-07 12:45:52 -070027 Moveable src1; Moveable dst1(skstd::move(src1));
28 Moveable src2, dst2; dst2 = skstd::move(src2);
29}