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;
34 assert(c.max_load_factor() == 1);
37 typedef std::unordered_set<int> C;
40 assert(c.max_load_factor() == 1);
41 c.max_load_factor(2.5);
42 assert(c.max_load_factor() == 2.5);
44 #if __cplusplus >= 201103L
46 typedef std::unordered_set<int, std::hash<int>,
47 std::equal_to<int>, min_allocator<int>> C;
50 assert(c.max_load_factor() == 1);
53 typedef std::unordered_set<int, std::hash<int>,
54 std::equal_to<int>, min_allocator<int>> C;
57 assert(c.max_load_factor() == 1);
58 c.max_load_factor(2.5);
59 assert(c.max_load_factor() == 2.5);
62 #if _LIBCPP_DEBUG_LEVEL >= 1
64 typedef std::unordered_set<int> C;
66 c.max_load_factor(-0.5f);