1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
12 // class match_results<BidirectionalIterator, Allocator>
14 // match_results& operator=(match_results&& m);
18 #include "test_macros.h"
19 #include "test_allocator.h"
21 template <class CharT
, class Allocator
>
23 test(const Allocator
& a
)
25 typedef std::match_results
<const CharT
*, Allocator
> SM
;
30 assert(m1
.size() == 0);
32 if (std::allocator_traits
<Allocator
>::propagate_on_container_move_assignment::value
)
33 assert(m1
.get_allocator() == a
);
35 assert(m1
.get_allocator() == Allocator());
40 test
<char> (std::allocator
<std::sub_match
<const char *> >());
41 test
<wchar_t>(std::allocator
<std::sub_match
<const wchar_t *> >());
43 // test_allocator has POCMA -> false
44 test
<char> (test_allocator
<std::sub_match
<const char*> >(3));
45 test
<wchar_t>(test_allocator
<std::sub_match
<const wchar_t*> >(3));
47 // other_allocator has POCMA -> true
48 test
<char> (other_allocator
<std::sub_match
<const char*> >(3));
49 test
<wchar_t>(other_allocator
<std::sub_match
<const wchar_t*> >(3));