Implement heterogeneous count() for multimap

This commit is contained in:
Christian Mazakas
2021-12-21 14:51:25 -08:00
parent 58326b8fff
commit 77c4a09a9b

View File

@ -1487,6 +1487,18 @@ namespace boost {
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 ? table_.group_count(n) : 0;
}
std::pair<iterator, iterator> equal_range(const key_type&);
std::pair<const_iterator, const_iterator> equal_range(
const key_type&) const;