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 //===----------------------------------------------------------------------===//
13 // multimap(const multimap& m, const allocator_type& a);
18 #include "test_macros.h"
19 #include "../../../test_compare.h"
20 #include "test_allocator.h"
21 #include "min_allocator.h"
26 typedef std::pair
<const int, double> V
;
39 typedef test_less
<int> C
;
40 typedef test_allocator
<V
> A
;
41 std::multimap
<int, double, C
, A
> mo(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]), C(5), A(7));
42 std::multimap
<int, double, C
, A
> m(mo
, A(3));
44 assert(m
.get_allocator() == A(3));
45 assert(m
.key_comp() == C(5));
47 assert(mo
.get_allocator() == A(7));
48 assert(mo
.key_comp() == C(5));
50 #if TEST_STD_VER >= 11
52 typedef std::pair
<const int, double> V
;
65 typedef test_less
<int> C
;
66 typedef min_allocator
<V
> A
;
67 std::multimap
<int, double, C
, A
> mo(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]), C(5), A());
68 std::multimap
<int, double, C
, A
> m(mo
, A());
70 assert(m
.get_allocator() == A());
71 assert(m
.key_comp() == C(5));
73 assert(mo
.get_allocator() == A());
74 assert(mo
.key_comp() == C(5));
77 typedef std::pair
<const int, double> V
;
90 typedef test_less
<int> C
;
91 typedef explicit_allocator
<V
> A
;
92 std::multimap
<int, double, C
, A
> mo(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]), C(5), A
{});
93 std::multimap
<int, double, C
, A
> m(mo
, A
{});
95 assert(m
.get_allocator() == A
{});
96 assert(m
.key_comp() == C(5));
98 assert(mo
.get_allocator() == A
{});
99 assert(mo
.key_comp() == C(5));