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