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 //===----------------------------------------------------------------------===//
11 // template<class Key, class T, class Compare, class Alloc>
12 // bool operator==(const std::multimap<Key, T, Compare, Alloc>& lhs,
13 // const std::multimap<Key, T, Compare, Alloc>& rhs);
15 // template<class Key, class T, class Compare, class Alloc>
16 // bool operator!=(const std::multimap<Key, T, Compare, Alloc>& lhs,
17 // const std::multimap<Key, T, Compare, Alloc>& rhs);
19 // template<class Key, class T, class Compare, class Alloc>
20 // bool operator<(const std::multimap<Key, T, Compare, Alloc>& lhs,
21 // const std::multimap<Key, T, Compare, Alloc>& rhs);
23 // template<class Key, class T, class Compare, class Alloc>
24 // bool operator>(const std::multimap<Key, T, Compare, Alloc>& lhs,
25 // const std::multimap<Key, T, Compare, Alloc>& rhs);
27 // template<class Key, class T, class Compare, class Alloc>
28 // bool operator<=(const std::multimap<Key, T, Compare, Alloc>& lhs,
29 // const std::multimap<Key, T, Compare, Alloc>& rhs);
31 // template<class Key, class T, class Compare, class Alloc>
32 // bool operator>=(const std::multimap<Key, T, Compare, Alloc>& lhs,
33 // const std::multimap<Key, T, Compare, Alloc>& rhs);
39 #include "test_comparisons.h"
41 int main(int, char**) {
42 typedef std::multimap
<int, std::string
> map_type
;
43 typedef map_type::value_type value_type
;
46 m1
.insert(value_type(1, "abc"));
47 m2
.insert(value_type(2, "abc"));
48 const map_type
& cm1
= m1
, cm2
= m2
;
49 assert(testComparisons(cm1
, cm2
, false, true));
53 m1
.insert(value_type(1, "abc"));
54 m2
.insert(value_type(1, "abc"));
55 const map_type
& cm1
= m1
, cm2
= m2
;
56 assert(testComparisons(cm1
, cm2
, true, false));
60 m1
.insert(value_type(1, "ab"));
61 m2
.insert(value_type(1, "abc"));
62 const map_type
& cm1
= m1
, cm2
= m2
;
63 assert(testComparisons(cm1
, cm2
, false, true));
67 m1
.insert(value_type(1, "abc"));
68 m2
.insert(value_type(1, "bcd"));
69 const map_type
& cm1
= m1
, cm2
= m2
;
70 assert(testComparisons(cm1
, cm2
, false, true));
74 m1
.insert(value_type(1, "abc"));
75 m2
.insert(value_type(1, "abc"));
76 m2
.insert(value_type(2, "abc"));
77 const map_type
& cm1
= m1
, cm2
= m2
;
78 assert(testComparisons(cm1
, cm2
, false, true));
82 m1
.insert(value_type(1, "abc"));
83 m2
.insert(value_type(1, "abc"));
84 m2
.insert(value_type(1, "abc"));
85 m2
.insert(value_type(1, "bcd"));
86 const map_type
& cm1
= m1
, cm2
= m2
;
87 assert(testComparisons(cm1
, cm2
, false, true));