blob: 1653136891aed6c0561686ed8d17c5c6d158222b [file] [log] [blame]
Howard Hinnant3e519522010-05-11 19:42:16 +00001//===----------------------------------------------------------------------===//
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// <string>
11
12// reverse_iterator rbegin();
13// const_reverse_iterator rbegin() const;
14
15#include <string>
16#include <cassert>
17
18template <class S>
19void
20test(S s)
21{
22 const S& cs = s;
23 typename S::reverse_iterator b = s.rbegin();
24 typename S::const_reverse_iterator cb = cs.rbegin();
25 if (!s.empty())
26 {
27 assert(*b == s.back());
28 }
29 assert(b == cb);
30}
31
32int main()
33{
34 typedef std::string S;
35 test(S());
36 test(S("123"));
37}