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 // template <RandomAccessIterator Iter1, RandomAccessIterator Iter2>
15 // requires HasLess<Iter2, Iter1>
17 // operator>(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y);
24 #include "test_macros.h"
25 #include "test_iterators.h"
29 test(It l, It r, bool x)
31 const std::move_iterator<It> r1(l);
32 const std::move_iterator<It> r2(r);
33 assert((r1 > r2) == x);
38 char s[] = "1234567890";
39 test(random_access_iterator<char*>(s), random_access_iterator<char*>(s), false);
40 test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1), false);
41 test(random_access_iterator<char*>(s+1), random_access_iterator<char*>(s), true);
48 constexpr const char *p = "123456789";
49 typedef std::move_iterator<const char *> MI;
50 constexpr MI it1 = std::make_move_iterator(p);
51 constexpr MI it2 = std::make_move_iterator(p + 5);
52 constexpr MI it3 = std::make_move_iterator(p);
53 static_assert(!(it1 > it2), "");
54 static_assert(!(it1 > it3), "");
55 static_assert( (it2 > it3), "");