1*d5db71d1SArthur O'Dwyer //===----------------------------------------------------------------------===//
2*d5db71d1SArthur O'Dwyer //
3*d5db71d1SArthur O'Dwyer // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*d5db71d1SArthur O'Dwyer // See https://llvm.org/LICENSE.txt for license information.
5*d5db71d1SArthur O'Dwyer // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*d5db71d1SArthur O'Dwyer //
7*d5db71d1SArthur O'Dwyer //===----------------------------------------------------------------------===//
8*d5db71d1SArthur O'Dwyer
9*d5db71d1SArthur O'Dwyer // <unordered_map>
10*d5db71d1SArthur O'Dwyer
11*d5db71d1SArthur O'Dwyer // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
12*d5db71d1SArthur O'Dwyer // class Alloc = allocator<pair<const Key, T>>>
13*d5db71d1SArthur O'Dwyer // class unordered_multimap
14*d5db71d1SArthur O'Dwyer
15*d5db71d1SArthur O'Dwyer // template <typename K>
16*d5db71d1SArthur O'Dwyer // pair<iterator, iterator> equal_range(const K& k);
17*d5db71d1SArthur O'Dwyer
18*d5db71d1SArthur O'Dwyer // UNSUPPORTED: c++03, c++11, c++14, c++17
19*d5db71d1SArthur O'Dwyer
20*d5db71d1SArthur O'Dwyer #include <unordered_map>
21*d5db71d1SArthur O'Dwyer
22*d5db71d1SArthur O'Dwyer #include "test_transparent_unordered.h"
23*d5db71d1SArthur O'Dwyer
main(int,char **)24*d5db71d1SArthur O'Dwyer int main(int, char**)
25*d5db71d1SArthur O'Dwyer {
26*d5db71d1SArthur O'Dwyer using key_type = StoredType<int>;
27*d5db71d1SArthur O'Dwyer
28*d5db71d1SArthur O'Dwyer {
29*d5db71d1SArthur O'Dwyer // Make sure conversions don't happen for transparent non-final hasher and key_equal
30*d5db71d1SArthur O'Dwyer using M = unord_map_type<std::unordered_multimap, transparent_hash, std::equal_to<>>;
31*d5db71d1SArthur O'Dwyer test_transparent_equal_range<M>({{1, 2}, {1, 3}, {2, 3}});
32*d5db71d1SArthur O'Dwyer test_transparent_equal_range<const M>({{1, 2}, {1, 3}, {2, 3}});
33*d5db71d1SArthur O'Dwyer }
34*d5db71d1SArthur O'Dwyer
35*d5db71d1SArthur O'Dwyer {
36*d5db71d1SArthur O'Dwyer // Make sure conversions don't happen for transparent final hasher and key_equal
37*d5db71d1SArthur O'Dwyer using M = unord_map_type<std::unordered_multimap, transparent_hash_final, transparent_equal_final>;
38*d5db71d1SArthur O'Dwyer test_transparent_equal_range<M>({{1, 2}, {1, 3}, {2, 3}});
39*d5db71d1SArthur O'Dwyer test_transparent_equal_range<const M>({{1, 2}, {1, 3}, {2, 3}});
40*d5db71d1SArthur O'Dwyer }
41*d5db71d1SArthur O'Dwyer
42*d5db71d1SArthur O'Dwyer {
43*d5db71d1SArthur O'Dwyer // Make sure conversions do happen for non-transparent hasher
44*d5db71d1SArthur O'Dwyer using M = unord_map_type<std::unordered_multimap, non_transparent_hash, std::equal_to<>>;
45*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<M>({{1, 2}, {1, 3}, {2, 3}});
46*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<const M>({{1, 2}, {1, 3}, {2, 3}});
47*d5db71d1SArthur O'Dwyer }
48*d5db71d1SArthur O'Dwyer
49*d5db71d1SArthur O'Dwyer {
50*d5db71d1SArthur O'Dwyer // Make sure conversions do happen for non-transparent key_equal
51*d5db71d1SArthur O'Dwyer using M = unord_map_type<std::unordered_multimap, transparent_hash, std::equal_to<key_type>>;
52*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<M>({{1, 2}, {1, 3}, {2, 3}});
53*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<const M>({{1, 2}, {1, 3}, {2, 3}});
54*d5db71d1SArthur O'Dwyer }
55*d5db71d1SArthur O'Dwyer
56*d5db71d1SArthur O'Dwyer {
57*d5db71d1SArthur O'Dwyer // Make sure conversions do happen for both non-transparent hasher and key_equal
58*d5db71d1SArthur O'Dwyer using M = unord_map_type<std::unordered_multimap, non_transparent_hash, std::equal_to<key_type>>;
59*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<M>({{1, 2}, {1, 3}, {2, 3}});
60*d5db71d1SArthur O'Dwyer test_non_transparent_equal_range<const M>({{1, 2}, {1, 3}, {2, 3}});
61*d5db71d1SArthur O'Dwyer }
62*d5db71d1SArthur O'Dwyer
63*d5db71d1SArthur O'Dwyer return 0;
64*d5db71d1SArthur O'Dwyer }
65