# std::unordered_set<Key,Hash,KeyEqual,Allocator>::key_eq

> C++ Atlas: `cppatlas.com/w/cpp/container/unordered_set/key_eq` | Source: https://en.cppreference.com/w/cpp/container/unordered_set/key_eq | Domain: Containers | Standards: C++11

Returns the function that compares keys for equality.

## Official Specification Summary (cppreference)

```cpp
key_equal key_eq() const; // (since C++11)
```

Returns the function that compares keys for equality.

### Parameters

(none)

### Return value

The key comparison function.

### Complexity

Constant.

### See also

- [`hash_function`](https://en.cppreference.com/w/cpp/container/unordered_set/hash_function): returns function used to hash the keys (public member function)

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