1//===----------------------------------------------------------------------===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8
9// <map>
10
11// class map
12
13// explicit map(const key_compare& comp);
14
15#include <map>
16#include <cassert>
17
18#include "test_macros.h"
19#include "../../../test_compare.h"
20#include "min_allocator.h"
21
22int main(int, char**) {
23 {
24 typedef test_less<int> C;
25 const std::map<int, double, C> m(C(3));
26 assert(m.empty());
27 assert(m.begin() == m.end());
28 assert(m.key_comp() == C(3));
29 }
30#if TEST_STD_VER >= 11
31 {
32 typedef test_less<int> C;
33 const std::map<int, double, C, min_allocator<std::pair<const int, double>>> m(C(3));
34 assert(m.empty());
35 assert(m.begin() == m.end());
36 assert(m.key_comp() == C(3));
37 }
38#endif
39
40 return 0;
41}
42

source code of libcxx/test/std/containers/associative/map/map.cons/compare.pass.cpp