(C++17) | ||||
Sequence | ||||
(C++11) | ||||
(C++26) | ||||
(C++26) | ||||
(C++11) | ||||
Associative | ||||
Unordered associative | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
Adaptors | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
Views | ||||
(C++20) | ||||
(C++23) | ||||
Tables | ||||
Iterator invalidation | ||||
Member function table | ||||
Non-member function table |
std::unordered_set
Member types | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Member functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Non-member functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Deduction guides(C++17) |
size_type bucket(const Key& key)const; | (1) | (since C++11) |
template<typename K> size_type bucket(const K& x)const; | (2) | (since C++26) |
Hash
andKeyEqual
are bothtransparent. This assumes that suchHash
is callable with bothK
andKey
type, and that theKeyEqual
is transparent, which, together, allows calling this function without constructing an instance ofKey
.The returned value is valid only for instances of the container for whichbucket_count() returns the same value (e.g.,rehash() invalidates previously obtained value).
The behavior is undefined ifbucket_count() is zero.
Contents |
key | - | the value of the key to examine |
x | - | a value of any type that can be transparently compared with a key |
Bucket index for the requested key.
Constant.
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_associative_heterogeneous_insertion | 202311L | (C++26) | Heterogeneous overloads for the remaining member functions inordered andunordered associativecontainers.(2) |
This section is incomplete Reason: no example |
returns the number of elements in specific bucket (public member function)[edit] |