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 <RandomAccessIterator Iter1, RandomAccessIterator Iter2> 15 // requires HasLess<Iter2, Iter1> 16 // bool 17 // operator<=(const move_iterator<Iter1>& x, const move_iterator<Iter2>& y); 18 19 #include <iterator> 20 #include <cassert> 21 22 #include "test_iterators.h" 23 24 template <class It> 25 void 26 test(It l, It r, bool x) 27 { 28 const std::move_iterator<It> r1(l); 29 const std::move_iterator<It> r2(r); 30 assert((r1 <= r2) == x); 31 } 32 33 int main() 34 { 35 char s[] = "1234567890"; 36 test(random_access_iterator<char*>(s), random_access_iterator<char*>(s), true); 37 test(random_access_iterator<char*>(s), random_access_iterator<char*>(s+1), true); 38 test(random_access_iterator<char*>(s+1), random_access_iterator<char*>(s), false); 39 test(s, s, true); 40 test(s, s+1, true); 41 test(s+1, s, false); 42 } 43