Implement heterogeneous count() for set

This commit is contained in:
Christian Mazakas
2022-01-03 13:35:07 -08:00
parent ccbe691cc8
commit 56f11f94d8

View File

@ -500,6 +500,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 ? 1 : 0;
}
std::pair<const_iterator, const_iterator> equal_range(
const key_type&) const;