• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
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>
26 #include "test_macros.h"
27 
28 void
test()29 test()
30 {
31     std::match_results<const char*> m1;
32     const char s[] = "abcdefghijk";
33     assert(std::regex_search(s, m1, std::regex("cd((e)fg)hi")));
34     std::match_results<const char*> m2;
35 
36     assert(m1 == m1);
37     assert(m1 != m2);
38 
39     m2 = m1;
40 
41     assert(m1 == m2);
42 }
43 
main()44 int main()
45 {
46     test();
47 }
48