From 05373cbb6ba510ad1b395413d0ee002688772854 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Thu, 23 Dec 2021 09:54:12 -0800 Subject: [PATCH] Implement heterogeneous `find()` for set --- 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 f63b260b..78887a48 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -472,6 +472,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&,