1 namespace std { 2 template <typename _Tp> 3 struct remove_reference { 4 typedef _Tp type; 5 }; 6 7 template <typename _Tp> move(_Tp && __t)8constexpr typename std::remove_reference<_Tp>::type &&move(_Tp &&__t) { 9 return static_cast<typename std::remove_reference<_Tp>::type &&>(__t); 10 } 11 } // namespace std 12 13 struct TriviallyCopyable { 14 int i; 15 }; 16 17 class A { 18 public: A()19 A() {} A(const A & rhs)20 A(const A &rhs) {} A(A && rhs)21 A(A &&rhs) {} 22 }; 23 f(TriviallyCopyable)24void f(TriviallyCopyable) {} 25 g()26void g() { 27 TriviallyCopyable obj; 28 f(std::move(obj)); 29 } 30 f5(const A x5)31A f5(const A x5) { 32 return std::move(x5); 33 } 34