# std::hash<std::text_encoding>

> C++ Atlas: `cppatlas.com/w/cpp/text/text_encoding/hash` | Source: https://en.cppreference.com/w/cpp/text/text_encoding/hash | Domain: Text processing | Standards: C++11, C++23, C++26

The template specialization of std::hash for std::text_encoding allows users to obtain hashes of encoded id and name of type std::text_encoding.

## Official Specification Summary (cppreference)

```cpp
// Defined in header <text_encoding>
template<> struct hash<std::text_encoding>; // (since C++26)
```

The template specialization of `std::hash` for `std::text_encoding` allows users to obtain hashes of encoded id and name of type `std::text_encoding`.

`operator()` of this specialization is noexcept.

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`hash`](https://en.cppreference.com/w/cpp/utility/hash) (C++11): hash function object (class template)
- [`std::hash<std::basic_stacktrace>`](https://en.cppreference.com/w/cpp/utility/basic_stacktrace/hash) (C++23): hash support for `std::basic_stacktrace` (class template specialization)

---
Attribution: content from https://en.cppreference.com/w/cpp/text/text_encoding/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.