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 // <typeindex>
11 
12 // class type_index
13 
14 // template <>
15 // struct hash<type_index>
16 //     : public unary_function<type_index, size_t>
17 // {
18 //     size_t operator()(type_index index) const;
19 // };
20 
21 #include <typeindex>
22 #include <cassert>
23 
main()24 int main()
25 {
26     std::type_index t1 = typeid(int);
27     assert(std::hash<std::type_index>()(t1) == t1.hash_code());
28 }
29