mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
Fix compiler error on clang/gcc
This commit is contained in:
Vendored
+2
-2
@@ -3401,7 +3401,7 @@ public:
|
||||
template <class K = key_type, class V = mapped_type>
|
||||
bool contains(const key_arg<K>& key, V& v) const {
|
||||
typename Lockable::SharedLock m;
|
||||
auto it = const_cast<parallel_hash_map *>(this)->find(key, hash(key), m);
|
||||
auto it = const_cast<parallel_hash_map *>(this)->find(key, Base::hash(key), m);
|
||||
if (it == this->end())
|
||||
return false;
|
||||
v = Policy::value(&*it);
|
||||
@@ -3411,7 +3411,7 @@ public:
|
||||
template <class K = key_type, class F>
|
||||
bool if_contains(const key_arg<K>& key, F&& f) const {
|
||||
typename Lockable::SharedLock m;
|
||||
auto it = const_cast<parallel_hash_map*>(this)->find(key, hash(key), m);
|
||||
auto it = const_cast<parallel_hash_map*>(this)->find(key, Base::hash(key), m);
|
||||
if (it == this->end())
|
||||
return false;
|
||||
std::forward<F>(f)(Policy::value(&*it));
|
||||
|
||||
Reference in New Issue
Block a user