blob: 5fbd46429d1373ca09281644e8dc9ee4c665ce9a [file] [log] [blame]
mtklein1138be42016-01-24 19:49:24 -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"
8#include "SkTemplates.h"
9#include <utility>
10
11namespace {
12class Moveable {
13public:
14 Moveable() {}
15 Moveable(Moveable&&) {}
16 Moveable& operator=(Moveable&&) { return *this; }
17private:
18 Moveable(const Moveable&);
19 Moveable& operator=(const Moveable&);
20};
21template <typename T> void deleter(T*) { }
22template <typename T> struct Deleter {
23 void operator()(T* t) { delete static_cast<const Moveable*>(t); }
24};
25} // namespace
26
27DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) {
28 Moveable src1; Moveable dst1(std::move(src1));
29 Moveable src2, dst2; dst2 = std::move(src2);
30}