Suppress more warnings for MSVC
[folly.git] / folly / Hash.h
index 0f0afc5baf71ac4c4ca301becf5f84e98fca6da5..314a98d0fdc6c0556f8f6455ae2582179c685bfc 100644 (file)
@@ -365,7 +365,8 @@ template <>
 struct hasher<bool> {
   size_t operator()(bool key) const {
     // Make sure that all the output bits depend on the input.
-    return -static_cast<size_t>(key);
+    using u = std::make_signed<size_t>::type;
+    return static_cast<size_t>(-static_cast<u>(key));
   }
 };