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 // move_iterator operator--(int);
21 #include "test_macros.h"
22 #include "test_iterators.h"
28 std::move_iterator<It> r(i);
29 std::move_iterator<It> rr = r--;
30 assert(r.base() == x);
31 assert(rr.base() == i);
37 test(bidirectional_iterator<char*>(s+1), bidirectional_iterator<char*>(s));
38 test(random_access_iterator<char*>(s+1), random_access_iterator<char*>(s));
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+1);
47 static_assert(it1 != it2, "");
48 constexpr MI it3 = std::make_move_iterator(p+1) --;
49 static_assert(it1 != it3, "");
50 static_assert(it2 == it3, "");