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 // struct hash<type_index> 13 // : public unary_function<type_index, size_t> 14 // { 15 // size_t operator()(type_index index) const; 16 // }; 17 18 #include <typeindex> 19 #include <type_traits> 20 main()21int main() 22 { 23 typedef std::hash<std::type_index> H; 24 static_assert((std::is_same<typename H::argument_type, std::type_index>::value), "" ); 25 static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" ); 26 } 27