From d7ffd48c67cc2056cb08131fac3786e439272185 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 29 Dec 2021 11:42:32 -0800 Subject: [PATCH 1/2] Add transparent test support for multiset's `find()` --- test/unordered/transparent_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unordered/transparent_tests.cpp b/test/unordered/transparent_tests.cpp index 3f7871f4..e703a13a 100644 --- a/test/unordered/transparent_tests.cpp +++ b/test/unordered/transparent_tests.cpp @@ -1488,6 +1488,7 @@ void test_unordered_multiset() transparent_key_equal> unordered_set; + test_set_transparent_find(); test_set_transparent_equal_range(); } @@ -1496,6 +1497,7 @@ void test_unordered_multiset() // typedef boost::unordered_multiset unordered_set; + test_set_non_transparent_find(); test_set_non_transparent_equal_range(); } @@ -1505,6 +1507,7 @@ void test_unordered_multiset() typedef boost::unordered_multiset unordered_set; + test_set_non_transparent_find(); test_set_non_transparent_equal_range(); } @@ -1514,6 +1517,7 @@ void test_unordered_multiset() typedef boost::unordered_multiset unordered_set; + test_set_non_transparent_find(); test_set_non_transparent_equal_range(); } } From 202a43804422d823ec524cfc691dbc638c110920 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 29 Dec 2021 11:42:46 -0800 Subject: [PATCH 2/2] Implement heterogeneous `find()` for multiset --- include/boost/unordered/unordered_set.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index f710c702..ecb12bda 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -1053,6 +1053,16 @@ namespace boost { const_iterator find(const key_type&) const; + template + typename boost::enable_if_c::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 const_iterator find(CompatibleKey const&, CompatibleHash const&,