post.pass.cpp revision bc8d3f97eb5c958007f2713238472e0c1c8fe02c
1//===----------------------------------------------------------------------===//
2//
3// ��������������������The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <iterator>
11
12// reverse_iterator
13
14// reverse_iterator operator--(int);
15
16#include <iterator>
17#include <cassert>
18
19#include "../../../../iterators.h"
20
21template <class It>
22void
23test(It i, It x)
24{
25    std::reverse_iterator<It> r(i);
26    std::reverse_iterator<It> rr = r--;
27    assert(r.base() == x);
28    assert(rr.base() == i);
29}
30
31int main()
32{
33    const char* s = "123";
34    test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
35    test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
36    test(s+1, s+2);
37}
38