about summary refs log tree commit diff
path: root/absl/hash/internal/hash.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/hash/internal/hash.h')
-rw-r--r--absl/hash/internal/hash.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index 6c00f35413d1..ba6d7468e1b8 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -541,17 +541,8 @@ hash_range_or_bytes(H hash_state, const T* data, size_t size) {
 //   * If is_uniquely_represented, hash bytes directly.
 //   * ADL AbslHashValue(H, const T&) call.
 //   * std::hash<T>
-
-// In MSVC we can't probe std::hash or stdext::hash because it triggers a
-// static_assert instead of failing substitution.
-#if defined(_MSC_VER)
-#define ABSL_HASH_INTERNAL_CAN_POISON_ 0
-#else   // _MSC_VER
-#define ABSL_HASH_INTERNAL_CAN_POISON_ 1
-#endif  // _MSC_VER
-
 #if defined(ABSL_INTERNAL_LEGACY_HASH_NAMESPACE) && \
-    ABSL_HASH_INTERNAL_CAN_POISON_
+    ABSL_META_INTERNAL_STD_HASH_SFINAE_FRIENDLY_
 #define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 1
 #else
 #define ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_ 0
@@ -616,13 +607,7 @@ struct HashSelect {
 #endif  // ABSL_HASH_INTERNAL_SUPPORT_LEGACY_HASH_
 
   template <typename U>
-  using ProbeStdHash =
-#if ABSL_HASH_INTERNAL_CAN_POISON_
-      std::is_convertible<decltype(std::hash<U>()(std::declval<const U&>())),
-                          size_t>;
-#else   // ABSL_HASH_INTERNAL_CAN_POISON_
-      std::true_type;
-#endif  // ABSL_HASH_INTERNAL_CAN_POISON_
+  using ProbeStdHash = absl::type_traits_internal::IsHashable<U>;
 
   template <typename U>
   using ProbeNone = std::true_type;