1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
13 // class Alloc = allocator<Value>>
14 // class unordered_set
16 // float max_load_factor() const;
17 // void max_load_factor(float mlf);
20 #define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
23 #include <unordered_set>
26 #include "min_allocator.h"
31 typedef std::unordered_set<int> C;
33 assert(c.max_load_factor() == 1);
36 typedef std::unordered_set<int> C;
38 assert(c.max_load_factor() == 1);
39 c.max_load_factor(2.5);
40 assert(c.max_load_factor() == 2.5);
42 #if TEST_STD_VER >= 11
44 typedef std::unordered_set<int, std::hash<int>,
45 std::equal_to<int>, min_allocator<int>> C;
47 assert(c.max_load_factor() == 1);
50 typedef std::unordered_set<int, std::hash<int>,
51 std::equal_to<int>, min_allocator<int>> C;
53 assert(c.max_load_factor() == 1);
54 c.max_load_factor(2.5);
55 assert(c.max_load_factor() == 2.5);
58 #if _LIBCPP_DEBUG_LEVEL >= 1
60 typedef std::unordered_set<int> C;
62 c.max_load_factor(-0.5f);