Home | History | Annotate | Download | only in unord.set
      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 int main()
     34 {
     35     {
     36         typedef std::unordered_set<short> C;
     37         static_assert((std::is_same<C::value_type, short>::value), "");
     38         static_assert((std::is_same<C::key_type, short>::value), "");
     39         static_assert((std::is_same<C::hasher, std::hash<C::key_type> >::value), "");
     40         static_assert((std::is_same<C::key_equal, std::equal_to<C::key_type> >::value), "");
     41         static_assert((std::is_same<C::allocator_type, std::allocator<C::value_type> >::value), "");
     42         static_assert((std::is_same<C::reference, C::value_type&>::value), "");
     43         static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
     44         static_assert((std::is_same<C::pointer, C::value_type*>::value), "");
     45         static_assert((std::is_same<C::const_pointer, const C::value_type*>::value), "");
     46         static_assert((std::is_same<C::size_type, std::size_t>::value), "");
     47         static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
     48     }
     49 }
     50