mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-30 19:37:14 +02:00
Implement heterogeneous equal_range()
for multimap
This commit is contained in:
@ -1477,6 +1477,32 @@ namespace boost {
|
|||||||
std::pair<const_iterator, const_iterator> equal_range(
|
std::pair<const_iterator, const_iterator> equal_range(
|
||||||
const key_type&) const;
|
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
|
// bucket interface
|
||||||
|
|
||||||
size_type bucket_count() const BOOST_NOEXCEPT
|
size_type bucket_count() const BOOST_NOEXCEPT
|
||||||
|
Reference in New Issue
Block a user