1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // test move 11 12 // UNSUPPORTED: c++98, c++03 13 14 #include <utility> 15 #include <cassert> 16 17 class move_only 18 { 19 move_only(const move_only&); 20 move_only& operator=(const move_only&); 21 public: move_only(move_only &&)22 move_only(move_only&&) {} operator =(move_only &&)23 move_only& operator=(move_only&&) {return *this;} 24 move_only()25 move_only() {} 26 }; 27 source()28move_only source() {return move_only();} csource()29const move_only csource() {return move_only();} 30 test(move_only)31void test(move_only) {} 32 main()33int main() 34 { 35 move_only mo; 36 37 test(std::move(mo)); 38 test(source()); 39 } 40