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 27 void 28 test() 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 43 int main() 44 { 45 test(); 46 } 47