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 // template <class InputIterator>
14 // map(InputIterator first, InputIterator last);
19 #include "test_macros.h"
20 #include "min_allocator.h"
25 typedef std::pair
<const int, double> V
;
38 std::map
<int, double> m(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]));
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));
45 #if TEST_STD_VER >= 11
47 typedef std::pair
<const int, double> V
;
60 std::map
<int, double, std::less
<int>, min_allocator
<std::pair
<const int, double>>> m(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]));
61 assert(m
.size() == 3);
62 assert(std::distance(m
.begin(), m
.end()) == 3);
63 assert(*m
.begin() == V(1, 1));
64 assert(*std::next(m
.begin()) == V(2, 1));
65 assert(*std::next(m
.begin(), 2) == V(3, 1));