1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // multimap(const multimap& m);
19 #include "test_macros.h"
20 #include "../../../test_compare.h"
21 #include "test_allocator.h"
22 #include "min_allocator.h"
27 typedef std::pair<const int, double> V;
40 typedef test_compare<std::less<int> > C;
41 typedef test_allocator<V> A;
42 std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A(7));
43 std::multimap<int, double, C, A> m = mo;
45 assert(m.get_allocator() == A(7));
46 assert(m.key_comp() == C(5));
48 assert(mo.get_allocator() == A(7));
49 assert(mo.key_comp() == C(5));
51 #if TEST_STD_VER >= 11
53 typedef std::pair<const int, double> V;
66 typedef test_compare<std::less<int> > C;
67 typedef other_allocator<V> A;
68 std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A(7));
69 std::multimap<int, double, C, A> m = mo;
71 assert(m.get_allocator() == A(-2));
72 assert(m.key_comp() == C(5));
74 assert(mo.get_allocator() == A(7));
75 assert(mo.key_comp() == C(5));
78 typedef std::pair<const int, double> V;
91 typedef test_compare<std::less<int> > C;
92 typedef min_allocator<V> A;
93 std::multimap<int, double, C, A> mo(ar, ar+sizeof(ar)/sizeof(ar[0]), C(5), A());
94 std::multimap<int, double, C, A> m = mo;
96 assert(m.get_allocator() == A());
97 assert(m.key_comp() == C(5));
99 assert(mo.get_allocator() == A());
100 assert(mo.key_comp() == C(5));