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 //===----------------------------------------------------------------------===//
14 // requires RandomAccessIterator<Iter>
15 // move_iterator& operator+=(difference_type n);
22 #include "test_macros.h"
23 #include "test_iterators.h"
27 test(It i, typename std::iterator_traits<It>::difference_type n, It x)
29 std::move_iterator<It> r(i);
30 std::move_iterator<It>& rr = r += n;
31 assert(r.base() == x);
37 const char* s = "1234567890";
38 test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
43 constexpr const char *p = "123456789";
44 typedef std::move_iterator<const char *> MI;
45 constexpr MI it1 = std::make_move_iterator(p);
46 constexpr MI it2 = std::make_move_iterator(p + 5);
47 constexpr MI it3 = std::make_move_iterator(p) += 5;
48 static_assert(it1 != it2, "");
49 static_assert(it1 != it3, "");
50 static_assert(it2 == it3, "");