From e2b686593808c87bbdca415217f84fbfcba37b12 Mon Sep 17 00:00:00 2001 From: Christian Mazakas Date: Wed, 9 Feb 2022 14:03:34 -0800 Subject: [PATCH] Fix C4800 warnings in msvc by manually comparing pointers to 0 --- include/boost/unordered/unordered_map.hpp | 24 +++++++++++------------ include/boost/unordered/unordered_set.hpp | 24 +++++++++++------------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/include/boost/unordered/unordered_map.hpp b/include/boost/unordered/unordered_map.hpp index bc3608e8..a7815d87 100644 --- a/include/boost/unordered/unordered_map.hpp +++ b/include/boost/unordered/unordered_map.hpp @@ -798,9 +798,9 @@ namespace boost { bool contains(const key_type& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } template @@ -808,9 +808,9 @@ namespace boost { bool>::type contains(const Key& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } size_type count(const key_type&) const; @@ -1504,9 +1504,9 @@ namespace boost { bool contains(key_type const& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } template @@ -1514,9 +1514,9 @@ namespace boost { bool>::type contains(const Key& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } size_type count(const key_type&) const; diff --git a/include/boost/unordered/unordered_set.hpp b/include/boost/unordered/unordered_set.hpp index d6f1abc3..57133eda 100644 --- a/include/boost/unordered/unordered_set.hpp +++ b/include/boost/unordered/unordered_set.hpp @@ -509,9 +509,9 @@ namespace boost { bool contains(key_type const& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } template @@ -519,9 +519,9 @@ namespace boost { bool>::type contains(const Key& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } size_type count(const key_type&) const; @@ -1127,9 +1127,9 @@ namespace boost { bool contains(const key_type& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } template @@ -1137,9 +1137,9 @@ namespace boost { bool>::type contains(const Key& k) const { - return table_.find_node_impl( - table::policy::apply_hash(this->hash_function(), k), k, - this->key_eq()); + return 0 != table_.find_node_impl( + table::policy::apply_hash(this->hash_function(), k), k, + this->key_eq()); } size_type count(const key_type&) const;