Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Side by Side Diff: tests/CPlusPlusEleven.cpp

Issue 922043004: C++11 Unit Test for RValue semantics. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-02-13 (Friday) 17:54:58 EST Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gyp/tests.gypi ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
9 namespace {
10 template <class T> T&& Move(T& o) { return static_cast<T&&>(o); }
11
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 } // namespace
22
23 DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) {
24 Moveable src1; Moveable dst1(Move(src1));
25 Moveable src2, dst2; dst2 = Move(src2);
26 }
OLDNEW
« no previous file with comments | « gyp/tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698