llvm-project
74 строки · 2.4 Кб
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// <set>
10
11// template<class Key, class Compare, class Alloc>
12// bool operator==(const std::multiset<Key, Compare, Alloc>& lhs,
13// const std::multiset<Key, Compare, Alloc>& rhs);
14//
15// template<class Key, class Compare, class Alloc>
16// bool operator!=(const std::multiset<Key, Compare, Alloc>& lhs,
17// const std::multiset<Key, Compare, Alloc>& rhs);
18//
19// template<class Key, class Compare, class Alloc>
20// bool operator<(const std::multiset<Key, Compare, Alloc>& lhs,
21// const std::multiset<Key, Compare, Alloc>& rhs);
22//
23// template<class Key, class Compare, class Alloc>
24// bool operator>(const std::multiset<Key, Compare, Alloc>& lhs,
25// const std::multiset<Key, Compare, Alloc>& rhs);
26//
27// template<class Key, class Compare, class Alloc>
28// bool operator<=(const std::multiset<Key, Compare, Alloc>& lhs,
29// const std::multiset<Key, Compare, Alloc>& rhs);
30//
31// template<class Key, class Compare, class Alloc>
32// bool operator>=(const std::multiset<Key, Compare, Alloc>& lhs,
33// const std::multiset<Key, Compare, Alloc>& rhs);
34
35#include <set>36#include <cassert>37#include <string>38
39#include "test_comparisons.h"40
41int main(int, char**) {42{43std::multiset<int> s1, s2;44s1.insert(1);45s2.insert(2);46const std::multiset<int>& cs1 = s1, cs2 = s2;47assert(testComparisons(cs1, cs2, false, true));48}49{50std::multiset<int> s1, s2;51s1.insert(1);52s2.insert(1);53const std::multiset<int>& cs1 = s1, cs2 = s2;54assert(testComparisons(cs1, cs2, true, false));55}56{57std::multiset<int> s1, s2;58s1.insert(1);59s2.insert(1);60s2.insert(2);61const std::multiset<int>& cs1 = s1, cs2 = s2;62assert(testComparisons(cs1, cs2, false, true));63}64{65std::multiset<int> s1, s2;66s1.insert(1);67s2.insert(1);68s2.insert(1);69s2.insert(1);70const std::multiset<int>& cs1 = s1, cs2 = s2;71assert(testComparisons(cs1, cs2, false, true));72}73return 0;74}
75