xref: /llvm-project/libcxx/test/std/containers/associative/multimap/multimap.cons/compare.pass.cpp (revision 7fc6a55688c816f5fc1a5481ae7af25be7500356)
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 multimap
12 
13 // explicit multimap(const key_compare& comp);
14 
15 // key_compare key_comp() const;
16 
17 #include <map>
18 #include <cassert>
19 
20 #include "test_macros.h"
21 #include "../../../test_compare.h"
22 #include "min_allocator.h"
23 
24 int main(int, char**)
25 {
26     {
27     typedef test_compare<std::less<int> > C;
28     const std::multimap<int, double, C> m(C(3));
29     assert(m.empty());
30     assert(m.begin() == m.end());
31     assert(m.key_comp() == C(3));
32     }
33 #if TEST_STD_VER >= 11
34     {
35     typedef test_compare<std::less<int> > C;
36     const std::multimap<int, double, C, min_allocator<std::pair<const int, double>>> m(C(3));
37     assert(m.empty());
38     assert(m.begin() == m.end());
39     assert(m.key_comp() == C(3));
40     }
41 #endif
42 
43   return 0;
44 }
45