Implement unordered_map::contains()

This commit is contained in:
Christian Mazakas
2022-01-11 09:40:47 -08:00
parent 510267f6e9
commit a26e1c0f41

View File

@ -796,6 +796,23 @@ namespace boost {
const_iterator find(CompatibleKey const&, CompatibleHash const&,
CompatiblePredicate const&) const;
bool contains(const key_type& k) const
{
return table_.find_node_impl(
table::policy::apply_hash(this->hash_function(), k), k,
this->key_eq());
}
template <class Key>
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
bool>::type
contains(const Key& k) const
{
return table_.find_node_impl(
table::policy::apply_hash(this->hash_function(), k), k,
this->key_eq());
}
size_type count(const key_type&) const;
template <class Key>