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

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

Returns the number of buckets in the container.

## Official Specification Summary (cppreference)

```cpp
size_type bucket_count() const; // (since C++11)
```

Returns the number of buckets in the container.

### Parameters

(none)

### Return value

The number of buckets in the container.

### Complexity

Constant.

### See also

- [`bucket_size`](https://en.cppreference.com/w/cpp/container/unordered_set/bucket_size): returns the number of elements in specific bucket (public member function)
- [`max_bucket_count`](https://en.cppreference.com/w/cpp/container/unordered_set/max_bucket_count): returns the maximum number of buckets (public member function)

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