mirror of
https://github.com/boostorg/unordered.git
synced 2025-07-29 19:07:15 +02:00
Merge pull request #69 from cmazakas/multiset-heterogeneous-find
Multiset Heterogeneous `find()`
This commit is contained in:
@ -1053,6 +1053,16 @@ namespace boost {
|
||||
|
||||
const_iterator find(const key_type&) const;
|
||||
|
||||
template <class Key>
|
||||
typename boost::enable_if_c<detail::are_transparent<Key, H, P>::value,
|
||||
const_iterator>::type
|
||||
find(const Key& k) const
|
||||
{
|
||||
return const_iterator(table_.find_node_impl(
|
||||
table::policy::apply_hash(this->hash_function(), k), k,
|
||||
this->key_eq()));
|
||||
}
|
||||
|
||||
template <class CompatibleKey, class CompatibleHash,
|
||||
class CompatiblePredicate>
|
||||
const_iterator find(CompatibleKey const&, CompatibleHash const&,
|
||||
|
@ -1488,6 +1488,7 @@ void test_unordered_multiset()
|
||||
transparent_key_equal>
|
||||
unordered_set;
|
||||
|
||||
test_set_transparent_find<unordered_set>();
|
||||
test_set_transparent_equal_range<unordered_set>();
|
||||
}
|
||||
|
||||
@ -1496,6 +1497,7 @@ void test_unordered_multiset()
|
||||
//
|
||||
typedef boost::unordered_multiset<key, hasher, key_equal> unordered_set;
|
||||
|
||||
test_set_non_transparent_find<unordered_set>();
|
||||
test_set_non_transparent_equal_range<unordered_set>();
|
||||
}
|
||||
|
||||
@ -1505,6 +1507,7 @@ void test_unordered_multiset()
|
||||
typedef boost::unordered_multiset<key, transparent_hasher, key_equal>
|
||||
unordered_set;
|
||||
|
||||
test_set_non_transparent_find<unordered_set>();
|
||||
test_set_non_transparent_equal_range<unordered_set>();
|
||||
}
|
||||
|
||||
@ -1514,6 +1517,7 @@ void test_unordered_multiset()
|
||||
typedef boost::unordered_multiset<key, hasher, transparent_key_equal>
|
||||
unordered_set;
|
||||
|
||||
test_set_non_transparent_find<unordered_set>();
|
||||
test_set_non_transparent_equal_range<unordered_set>();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user