Debian Codegraph @

libcxx/test/std/re/re.results/re.results.const/allocator.pass.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // <regex>
10
11 // class match_results<BidirectionalIterator, Allocator>
12
13 // match_results(const Allocator& a = Allocator());
14
15 #include <regex>
16 #include <cassert>
17
18 #include "test_macros.h"
19 #include "test_allocator.h"
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.ready());
28 assert(m.get_allocator() == a);
29 }
30
31 int main(int, char**)
32 {
33 test<char>(test_allocator<std::sub_match<const char*> >(3));
34 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
35 test<wchar_t>(test_allocator<std::sub_match<const wchar_t*> >(3));
36 #endif
37
38 return 0;
39 }