Simplify hash_value for integrals

This commit is contained in:
Peter Dimov
2021-10-16 17:29:02 +03:00
parent 4e11c855cb
commit 2fc970b6ae
4 changed files with 45 additions and 141 deletions
+2 -3
View File
@@ -26,7 +26,7 @@
#pragma warning(disable:4310) // cast truncates constant value
#endif
#if defined(__GNUC__) && !defined(BOOST_INTEL_CXX_VERSION)
#if ( defined(__GNUC__) || defined(__clang__) ) && !defined(BOOST_INTEL_CXX_VERSION)
#pragma GCC diagnostic ignored "-Wfloat-equal"
#endif
@@ -37,8 +37,7 @@ void numeric_extra_tests(typename
{
typedef boost::hash_detail::limits<T> limits;
if(limits::is_signed ||
limits::digits <= boost::hash_detail::limits<std::size_t>::digits)
if(limits::digits <= boost::hash_detail::limits<std::size_t>::digits)
{
BOOST_TEST(BOOST_HASH_TEST_NAMESPACE::hash_value(T(-5)) == (std::size_t)T(-5));
}