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
18 #include <unordered_set>
21 #include "../../../NotConstructible.h"
22 #include "../../../test_compare.h"
23 #include "../../../test_hash.h"
24 #include "test_allocator.h"
25 #include "min_allocator.h"
30 typedef std::unordered_set<NotConstructible,
31 test_hash<std::hash<NotConstructible> >,
32 test_compare<std::equal_to<NotConstructible> >,
33 test_allocator<NotConstructible>
36 assert(c.bucket_count() == 0);
37 assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
38 assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
39 assert(c.get_allocator() == (test_allocator<NotConstructible>()));
40 assert(c.size() == 0);
42 assert(std::distance(c.begin(), c.end()) == 0);
43 assert(c.load_factor() == 0);
44 assert(c.max_load_factor() == 1);
46 #if __cplusplus >= 201103L
48 typedef std::unordered_set<NotConstructible,
49 test_hash<std::hash<NotConstructible> >,
50 test_compare<std::equal_to<NotConstructible> >,
51 min_allocator<NotConstructible>
54 assert(c.bucket_count() == 0);
55 assert(c.hash_function() == test_hash<std::hash<NotConstructible> >());
56 assert(c.key_eq() == test_compare<std::equal_to<NotConstructible> >());
57 assert(c.get_allocator() == (min_allocator<NotConstructible>()));
58 assert(c.size() == 0);
60 assert(std::distance(c.begin(), c.end()) == 0);
61 assert(c.load_factor() == 0);
62 assert(c.max_load_factor() == 1);