//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // // reverse_iterator // reverse_iterator operator--(int); #include #include #include "test_iterators.h" template void test(It i, It x) { std::reverse_iterator r(i); std::reverse_iterator rr = r--; assert(r.base() == x); assert(rr.base() == i); } int main() { const char* s = "123"; test(bidirectional_iterator(s+1), bidirectional_iterator(s+2)); test(random_access_iterator(s+1), random_access_iterator(s+2)); test(s+1, s+2); }