1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <unordered_set>
11
12 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
13 // class Alloc = allocator<Value>>
14 // class unordered_set
15 // {
16 // public:
17 // // types
18 // typedef Value value_type;
19 // typedef value_type key_type;
20 // typedef Hash hasher;
21 // typedef Pred key_equal;
22 // typedef Alloc allocator_type;
23 // typedef value_type& reference;
24 // typedef const value_type& const_reference;
25 // typedef typename allocator_traits<allocator_type>::pointer pointer;
26 // typedef typename allocator_traits<allocator_type>::const_pointer const_pointer;
27 // typedef typename allocator_traits<allocator_type>::size_type size_type;
28 // typedef typename allocator_traits<allocator_type>::difference_type difference_type;
29
30 #include <unordered_set>
31 #include <type_traits>
32
33 #include "min_allocator.h"
34
main()35 int main()
36 {
37 {
38 typedef std::unordered_set<short> C;
39 static_assert((std::is_same<C::value_type, short>::value), "");
40 static_assert((std::is_same<C::key_type, short>::value), "");
41 static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
42 static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
43 static_assert((std::is_same<C::allocator_type, std::allocator<C::value_type> >::value), "");
44 static_assert((std::is_same<C::reference, C::value_type&>::value), "");
45 static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
46 static_assert((std::is_same<C::pointer, C::value_type*>::value), "");
47 static_assert((std::is_same<C::const_pointer, const C::value_type*>::value), "");
48 static_assert((std::is_same<C::size_type, std::size_t>::value), "");
49 static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
50 }
51 #if __cplusplus >= 201103L
52 {
53 typedef std::unordered_set<short, std::hash<short>,
54 std::equal_to<short>, min_allocator<short>> C;
55 static_assert((std::is_same<C::value_type, short>::value), "");
56 static_assert((std::is_same<C::key_type, short>::value), "");
57 static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
58 static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
59 static_assert((std::is_same<C::allocator_type, min_allocator<C::value_type> >::value), "");
60 static_assert((std::is_same<C::reference, C::value_type&>::value), "");
61 static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
62 static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
63 static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
64 static_assert((std::is_same<C::size_type, std::size_t>::value), "");
65 static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
66 }
67 #endif
68 }
69