Implement unordered_set::contains()

This commit is contained in:
Christian Mazakas
2022-01-12 15:47:34 -08:00
parent a87277c6e8
commit f5d470c531

View File

@ -507,6 +507,23 @@ namespace boost {
const_iterator find(CompatibleKey const&, CompatibleHash const&,
CompatiblePredicate const&) const;
bool contains(key_type const& 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>