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 // <iterator> 11 12 // move_iterator 13 14 // template <class U> 15 // requires HasAssign<Iter, const U&> 16 // move_iterator& 17 // operator=(const move_iterator<U>& u); 18 19 // test requires 20 21 #include <iterator> 22 23 template <class It, class U> 24 void 25 test(U u) 26 { 27 const std::move_iterator<U> r2(u); 28 std::move_iterator<It> r1; 29 r1 = r2; 30 } 31 32 struct base {}; 33 struct derived {}; 34 35 int main() 36 { 37 derived d; 38 test<base*>(&d); 39 } 40