blob: 7902b8e642e49b84686f55010ffdeada98f8cb0d [file] [log] [blame]
Howard Hinnant27405f92010-08-14 18:14:02 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant27405f92010-08-14 18:14:02 +00007//
8//===----------------------------------------------------------------------===//
9
10// <regex>
11
12// class match_results<BidirectionalIterator, Allocator>
13
14// template <class BidirectionalIterator, class Allocator>
15// bool
16// operator==(const match_results<BidirectionalIterator, Allocator>& m1,
17// const match_results<BidirectionalIterator, Allocator>& m2);
18
19// template <class BidirectionalIterator, class Allocator>
20// bool
21// operator!=(const match_results<BidirectionalIterator, Allocator>& m1,
22// const match_results<BidirectionalIterator, Allocator>& m2);
23
24#include <regex>
25#include <cassert>
Howard Hinnant27405f92010-08-14 18:14:02 +000026
27void
28test()
29{
30 std::match_results<const char*> m1;
31 const char s[] = "abcdefghijk";
32 assert(std::regex_search(s, m1, std::regex("cd((e)fg)hi")));
33 std::match_results<const char*> m2;
34
35 assert(m1 == m1);
36 assert(m1 != m2);
37
38 m2 = m1;
39
40 assert(m1 == m2);
41}
42
43int main()
44{
45 test();
46}