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 | //===----------------------------------------------------------------------===// |
8 | |
9 | // <unordered_set> |
10 | |
11 | // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>, |
12 | // class Alloc = allocator<Value>> |
13 | // class unordered_multiset |
14 | |
15 | // float max_load_factor() const; |
16 | // void max_load_factor(float mlf); |
17 | |
18 | #include <unordered_set> |
19 | #include <cassert> |
20 | |
21 | #include "test_macros.h" |
22 | #include "min_allocator.h" |
23 | |
24 | int main(int, char**) { |
25 | { |
26 | typedef std::unordered_multiset<int> C; |
27 | const C c; |
28 | assert(c.max_load_factor() == 1); |
29 | } |
30 | { |
31 | typedef std::unordered_multiset<int> C; |
32 | C c; |
33 | assert(c.max_load_factor() == 1); |
34 | c.max_load_factor(z: 2.5); |
35 | assert(c.max_load_factor() == 2.5); |
36 | } |
37 | #if TEST_STD_VER >= 11 |
38 | { |
39 | typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; |
40 | const C c; |
41 | assert(c.max_load_factor() == 1); |
42 | } |
43 | { |
44 | typedef std::unordered_multiset<int, std::hash<int>, std::equal_to<int>, min_allocator<int>> C; |
45 | C c; |
46 | assert(c.max_load_factor() == 1); |
47 | c.max_load_factor(2.5); |
48 | assert(c.max_load_factor() == 2.5); |
49 | } |
50 | #endif |
51 | |
52 | return 0; |
53 | } |
54 | |