Implement heterogeneous count() for multiset

This commit is contained in:
Christian Mazakas
2022-01-03 14:43:51 -08:00
parent c485bc975a
commit d5e5c08b87

View File

@ -1092,6 +1092,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<const_iterator, const_iterator> equal_range(
const key_type&) const;