Implement heterogeneous equal_range() for multimap

This commit is contained in:
Christian Mazakas
2021-12-20 09:28:04 -08:00
parent 3d5a2d26d1
commit 19d2fe8738

View File

@ -1477,6 +1477,32 @@ namespace boost {
std::pair<const_iterator, const_iterator> equal_range(
const key_type&) const;
template <class Key>
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
std::pair<iterator, iterator> >::type
equal_range(const Key& key)
{
node_pointer p = table_.find_node_impl(
table::policy::apply_hash(this->hash_function(), key), key,
this->key_eq());
return std::make_pair(
iterator(p), iterator(p ? table_.next_group(p) : p));
}
template <class Key>
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
std::pair<const_iterator, const_iterator> >::type
equal_range(const Key& key) const
{
node_pointer p = table_.find_node_impl(
table::policy::apply_hash(this->hash_function(), key), key,
this->key_eq());
return std::make_pair(
const_iterator(p), const_iterator(p ? table_.next_group(p) : p));
}
// bucket interface
size_type bucket_count() const BOOST_NOEXCEPT