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 //===----------------------------------------------------------------------===//
15 // multimap(initializer_list<value_type> il, const key_compare& comp = key_compare());
20 #include "test_macros.h"
21 #include "min_allocator.h"
26 typedef std::multimap
<int, double> C
;
27 typedef C::value_type V
;
40 assert(m
.size() == 9);
41 assert(std::distance(m
.begin(), m
.end()) == 9);
42 C::const_iterator i
= m
.cbegin();
43 assert(*i
== V(1, 1));
44 assert(*++i
== V(1, 1.5));
45 assert(*++i
== V(1, 2));
46 assert(*++i
== V(2, 1));
47 assert(*++i
== V(2, 1.5));
48 assert(*++i
== V(2, 2));
49 assert(*++i
== V(3, 1));
50 assert(*++i
== V(3, 1.5));
51 assert(*++i
== V(3, 2));
54 typedef std::multimap
<int, double, std::less
<int>, min_allocator
<std::pair
<const int, double>>> C
;
55 typedef C::value_type V
;
68 assert(m
.size() == 9);
69 assert(std::distance(m
.begin(), m
.end()) == 9);
70 C::const_iterator i
= m
.cbegin();
71 assert(*i
== V(1, 1));
72 assert(*++i
== V(1, 1.5));
73 assert(*++i
== V(1, 2));
74 assert(*++i
== V(2, 1));
75 assert(*++i
== V(2, 1.5));
76 assert(*++i
== V(2, 2));
77 assert(*++i
== V(3, 1));
78 assert(*++i
== V(3, 1.5));
79 assert(*++i
== V(3, 2));