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 // map(initializer_list<value_type> il);
20 #include "test_macros.h"
21 #include "min_allocator.h"
26 typedef std::pair
<const int, double> V
;
27 std::map
<int, double> m
=
39 assert(m
.size() == 3);
40 assert(std::distance(m
.begin(), m
.end()) == 3);
41 assert(*m
.begin() == V(1, 1));
42 assert(*std::next(m
.begin()) == V(2, 1));
43 assert(*std::next(m
.begin(), 2) == V(3, 1));
46 typedef std::pair
<const int, double> V
;
47 std::map
<int, double, std::less
<int>, min_allocator
<V
>> m
=
59 assert(m
.size() == 3);
60 assert(std::distance(m
.begin(), m
.end()) == 3);
61 assert(*m
.begin() == V(1, 1));
62 assert(*std::next(m
.begin()) == V(2, 1));
63 assert(*std::next(m
.begin(), 2) == V(3, 1));