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 { Move(T & o)10template <class T> T&& Move(T& o) { return static_cast<T&&>(o); } 11 12 class Moveable { 13 public: Moveable()14 Moveable() {} Moveable(Moveable &&)15 Moveable(Moveable&&) {} operator =(Moveable &&)16 Moveable& operator=(Moveable&&) { return *this; } 17 private: 18 Moveable(const Moveable&); 19 Moveable& operator=(const Moveable&); 20 }; 21 } // namespace 22 DEF_TEST(CPlusPlusEleven_RvalueAndMove,r)23DEF_TEST(CPlusPlusEleven_RvalueAndMove, r) { 24 Moveable src1; Moveable dst1(Move(src1)); 25 Moveable src2, dst2; dst2 = Move(src2); 26 } 27