[RISCV] Add a default assignment of Inst{12-7} to RVInst16CSS. NFC
[llvm-project.git] / libcxx / test / std / containers / associative / multimap / multimap.ops / equal_range_transparent.pass.cpp
blob4315d573c6e2c0b56bd508b458efda967022baa3
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11
11 // <map>
13 // class multimap
15 // template<typename K>
16 // pair<iterator,iterator> equal_range(const K& x); // C++14
17 // template<typename K>
18 // pair<const_iterator,const_iterator> equal_range(const K& x) const;
19 // // C++14
21 #include <cassert>
22 #include <map>
23 #include <utility>
25 struct Comp {
26 using is_transparent = void;
28 bool operator()(const std::pair<int, int> &lhs,
29 const std::pair<int, int> &rhs) const {
30 return lhs < rhs;
33 bool operator()(const std::pair<int, int> &lhs, int rhs) const {
34 return lhs.first < rhs;
37 bool operator()(int lhs, const std::pair<int, int> &rhs) const {
38 return lhs < rhs.first;
42 int main(int, char**) {
43 std::multimap<std::pair<int, int>, int, Comp> s{
44 {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}};
46 auto er = s.equal_range(1);
47 long nels = 0;
49 for (auto it = er.first; it != er.second; it++) {
50 assert(it->first.first == 1);
51 nels++;
54 assert(nels == 3);
56 return 0;