Merge pull request #69 from cmazakas/multiset-heterogeneous-find

Multiset Heterogeneous `find()`
This commit is contained in:
Peter Dimov
2022-01-03 19:52:07 +02:00
committed by GitHub
2 changed files with 14 additions and 0 deletions

View File

@ -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&,

View File

@ -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>();
}
}