# std::hash<std::type_index>

> C++ Atlas: `cppatlas.com/w/cpp/types/type_index/hash` | Source: https://en.cppreference.com/w/cpp/types/type_index/hash | Domain: Type support | Standards: C++11

The template specialization of std::hash for std::type_index allows users to obtain hashes of objects of type std::type_index.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <typeindex>
template<> struct hash<std::type_index>; // (since C++11)
```

The template specialization of `std::hash` for `std::type_index` allows users to obtain hashes of objects of type `std::type_index`.

The member `operator()` effectively returns the same value as `hash_code()`.

### See also

- [`hash_code`](https://en.cppreference.com/w/cpp/types/type_index/hash_code): returns hashed code (public member function)

---
Attribution: content from https://en.cppreference.com/w/cpp/types/type_index/hash (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.