From 3bfc1784ad7609e6d3aec2f5e422528f7b0a67e5 Mon Sep 17 00:00:00 2001 From: Brian McKinnon Date: Sat, 2 May 2020 21:23:59 -0500 Subject: [PATCH] Fix compiler error for is_invocable is a c++17 feature --- parallel_hashmap/phmap.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index b89393e..0a38a7d 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -3394,8 +3394,8 @@ public: } template - std::enable_if_t::value, - bool> if_contains(const key_arg& key, V& v) const { + std::enable_if_t::value + , bool> if_contains(const key_arg& key, V& v) const { typename Lockable::SharedLock m; auto it = const_cast(this)->find(key, this->hash(key), m); if (it == this->end()) @@ -3405,8 +3405,11 @@ public: } template - std::enable_if_t::value && std::is_invocable::value, - bool> if_contains(const key_arg& key, F&& f) const { + std::enable_if_t::value +#if __cplusplus >= 201703L + && std::is_invocable::value +#endif + , bool> if_contains(const key_arg& key, F&& f) const { typename Lockable::SharedLock m; auto it = const_cast(this)->find(key, this->hash(key), m); if (it == this->end())