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 //===----------------------------------------------------------------------===//
13 // size_type count(const key_type& k) const;
18 #include "test_macros.h"
19 #include "min_allocator.h"
20 #include "private_constructor.h"
21 #include "is_transparent.h"
25 typedef std::pair
<const int, double> V
;
27 typedef std::multimap
<int, double> M
;
29 typedef M::size_type R
;
42 const M
m(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]));
59 #if TEST_STD_VER >= 11
61 typedef std::multimap
<int, double, std::less
<int>, min_allocator
<std::pair
<const int, double>>> M
;
63 typedef M::size_type R
;
76 const M
m(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]));
97 typedef std::multimap
<int, double, std::less
<>> M
;
98 typedef M::size_type R
;
111 const M
m(ar
, ar
+sizeof(ar
)/sizeof(ar
[0]));
127 r
= m
.count(C2Int(4));
129 r
= m
.count(C2Int(5));
131 r
= m
.count(C2Int(6));
133 r
= m
.count(C2Int(7));
135 r
= m
.count(C2Int(8));
137 r
= m
.count(C2Int(9));
139 r
= m
.count(C2Int(10));
144 typedef PrivateConstructor PC
;
145 typedef std::multimap
<PC
, double, std::less
<>> M
;
146 typedef M::size_type R
;
149 m
.insert ( std::make_pair
<PC
, double> ( PC::make(5), 1 ));
150 m
.insert ( std::make_pair
<PC
, double> ( PC::make(5), 2 ));
151 m
.insert ( std::make_pair
<PC
, double> ( PC::make(5), 3 ));
152 m
.insert ( std::make_pair
<PC
, double> ( PC::make(7), 1 ));
153 m
.insert ( std::make_pair
<PC
, double> ( PC::make(7), 2 ));
154 m
.insert ( std::make_pair
<PC
, double> ( PC::make(7), 3 ));
155 m
.insert ( std::make_pair
<PC
, double> ( PC::make(9), 1 ));
156 m
.insert ( std::make_pair
<PC
, double> ( PC::make(9), 2 ));
157 m
.insert ( std::make_pair
<PC
, double> ( PC::make(9), 3 ));