Howard Hinnant | 27405f9 | 2010-08-14 18:14:02 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Howard Hinnant | b64f8b0 | 2010-11-16 22:09:02 +0000 | [diff] [blame] | 5 | // This file is dual licensed under the MIT and the University of Illinois Open |
| 6 | // Source Licenses. See LICENSE.TXT for details. |
Howard Hinnant | 27405f9 | 2010-08-14 18:14:02 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <regex> |
| 11 | |
| 12 | // class match_results<BidirectionalIterator, Allocator> |
| 13 | |
| 14 | // match_results(const Allocator& a = Allocator()); |
| 15 | |
| 16 | #include <regex> |
| 17 | #include <cassert> |
| 18 | |
Marshall Clow | 1b92188 | 2013-12-03 00:18:10 +0000 | [diff] [blame] | 19 | #include "test_allocator.h" |
Howard Hinnant | 27405f9 | 2010-08-14 18:14:02 +0000 | [diff] [blame] | 20 | |
| 21 | template <class CharT, class Allocator> |
| 22 | void |
| 23 | test(const Allocator& a) |
| 24 | { |
| 25 | std::match_results<const CharT*, Allocator> m(a); |
| 26 | assert(m.size() == 0); |
| 27 | assert(m.str() == std::basic_string<CharT>()); |
| 28 | assert(m.get_allocator() == a); |
| 29 | } |
| 30 | |
| 31 | int main() |
| 32 | { |
| 33 | test<char>(test_allocator<std::sub_match<const char*> >(3)); |
| 34 | test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3)); |
| 35 | } |