[RISCV] Add a default assignment of Inst{12-7} to RVInst16CSS. NFC
[llvm-project.git] / libcxx / test / std / containers / associative / multimap / multimap.ops / count_transparent.pass.cpp
blob4bb08c6d928cb5413edebe0f6dafd861588d06ff
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 // size_type count(const K& x) const; // C++14
18 #include <cassert>
19 #include <map>
20 #include <utility>
22 struct Comp {
23 using is_transparent = void;
25 bool operator()(const std::pair<int, int> &lhs,
26 const std::pair<int, int> &rhs) const {
27 return lhs < rhs;
30 bool operator()(const std::pair<int, int> &lhs, int rhs) const {
31 return lhs.first < rhs;
34 bool operator()(int lhs, const std::pair<int, int> &rhs) const {
35 return lhs < rhs.first;
39 int main(int, char**) {
40 std::multimap<std::pair<int, int>, int, Comp> s{
41 {{2, 1}, 1}, {{1, 1}, 2}, {{1, 1}, 3}, {{1, 1}, 4}, {{2, 2}, 5}};
43 auto cnt = s.count(1);
44 assert(cnt == 3);
46 return 0;