mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Implement heterogeneous count()
for set
This commit is contained in:
@ -500,6 +500,18 @@ namespace boost {
|
|||||||
|
|
||||||
size_type count(const key_type&) const;
|
size_type count(const key_type&) const;
|
||||||
|
|
||||||
|
template <class Key>
|
||||||
|
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
|
||||||
|
size_type>::type
|
||||||
|
count(const Key& k) const
|
||||||
|
{
|
||||||
|
node_pointer n = table_.find_node_impl(
|
||||||
|
table::policy::apply_hash(this->hash_function(), k), k,
|
||||||
|
this->key_eq());
|
||||||
|
|
||||||
|
return n ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<const_iterator, const_iterator> equal_range(
|
std::pair<const_iterator, const_iterator> equal_range(
|
||||||
const key_type&) const;
|
const key_type&) const;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user