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 // void swap(multimap& m);
18 #include "test_macros.h"
19 #include "min_allocator.h"
23 typedef std::pair
<const int, double> V
;
25 typedef std::multimap
<int, double> M
;
32 assert(m1
== m2_save
);
33 assert(m2
== m1_save
);
48 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
52 assert(m1
== m2_save
);
53 assert(m2
== m1_save
);
63 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
68 assert(m1
== m2_save
);
69 assert(m2
== m1_save
);
90 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
91 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
95 assert(m1
== m2_save
);
96 assert(m2
== m1_save
);
99 #if TEST_STD_VER >= 11
101 typedef std::multimap
<int, double, std::less
<int>, min_allocator
<std::pair
<const int, double>>> M
;
108 assert(m1
== m2_save
);
109 assert(m2
== m1_save
);
124 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
128 assert(m1
== m2_save
);
129 assert(m2
== m1_save
);
139 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
144 assert(m1
== m2_save
);
145 assert(m2
== m1_save
);
166 M
m1(ar1
, ar1
+sizeof(ar1
)/sizeof(ar1
[0]));
167 M
m2(ar2
, ar2
+sizeof(ar2
)/sizeof(ar2
[0]));
171 assert(m1
== m2_save
);
172 assert(m2
== m1_save
);