1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
15 // requires HasConstructor<Iter, const U&>
16 // move_iterator(const move_iterator<U> &u);
23 #include "test_macros.h"
24 #include "test_iterators.h"
26 template <class It, class U>
30 const std::move_iterator<U> r2(u);
31 std::move_iterator<It> r1 = r2;
32 assert(r1.base() == u);
36 struct Derived : Base {};
42 test<input_iterator<Base*> >(input_iterator<Derived*>(&d));
43 test<forward_iterator<Base*> >(forward_iterator<Derived*>(&d));
44 test<bidirectional_iterator<Base*> >(bidirectional_iterator<Derived*>(&d));
45 test<random_access_iterator<const Base*> >(random_access_iterator<Derived*>(&d));
50 constexpr const Derived *p = nullptr;
51 constexpr std::move_iterator<const Derived *> it1 = std::make_move_iterator(p);
52 constexpr std::move_iterator<const Base *> it2(it1);
53 static_assert(it2.base() == p);