//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // move_iterator // requires RandomAccessIterator // move_iterator& operator+=(difference_type n); #include #include #include "test_iterators.h" template void test(It i, typename std::iterator_traits::difference_type n, It x) { std::move_iterator r(i); std::move_iterator& rr = r += n; assert(r.base() == x); assert(&rr == &r); } int main() { const char* s = "1234567890"; test(random_access_iterator(s+5), 5, random_access_iterator(s+10)); test(s+5, 5, s+10); }