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 //===----------------------------------------------------------------------===//
11 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
12 // class Alloc = allocator<Value>>
13 // class unordered_multiset
15 // template <typename K>
16 // bool contains(const K& x) const;
18 // UNSUPPORTED: c++03, c++11, c++14, c++17
20 #include <unordered_set>
21 #include "test_transparent_unordered.h"
25 using key_type
= StoredType
<int>;
28 // Make sure conversions don't happen for transparent non-final hasher and key_equal
29 using S
= unord_set_type
<std::unordered_multiset
, transparent_hash
, std::equal_to
<>>;
30 test_transparent_contains
<S
>({1, 1, 2});
31 test_transparent_contains
<const S
>({1, 1, 2});
35 // Make sure conversions don't happen for transparent final hasher and key_equal
36 using S
= unord_set_type
<std::unordered_multiset
, transparent_hash_final
, transparent_equal_final
>;
37 test_transparent_contains
<S
>({1, 1, 2});
38 test_transparent_contains
<const S
>({1, 1, 2});
42 // Make sure conversions do happen for non-transparent hasher
43 using S
= unord_set_type
<std::unordered_multiset
, non_transparent_hash
, std::equal_to
<>>;
44 test_non_transparent_contains
<S
>({1, 1, 2});
45 test_non_transparent_contains
<const S
>({1, 1, 2});
49 // Make sure conversions do happen for non-transparent key_equal
50 using S
= unord_set_type
<std::unordered_multiset
, transparent_hash
, std::equal_to
<key_type
>>;
51 test_non_transparent_contains
<S
>({1, 1, 2});
52 test_non_transparent_contains
<const S
>({1, 1, 2});
56 // Make sure conversions do happen for both non-transparent hasher and key_equal
57 using S
= unord_set_type
<std::unordered_multiset
, non_transparent_hash
, std::equal_to
<key_type
>>;
58 test_non_transparent_contains
<S
>({1, 1, 2});
59 test_non_transparent_contains
<const S
>({1, 1, 2});