diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index f5d59c19..a7765fe7 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -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 + typename boost::enable_if_c::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