GCC 32 bit under Windows has an 80 bit long double in 12 bytes, not 16

This commit is contained in:
Peter Dimov
2021-10-17 16:17:44 +03:00
parent 3487450f62
commit aaa1f441ac

View File

@@ -150,7 +150,24 @@ namespace boost
}
};
// 80 bit long double
// 80 bit long double in 12 bytes
template<class T> struct hash_float_impl<T, 96, 64>
{
static std::size_t fn( T v )
{
boost::uint64_t w[ 2 ] = {};
std::memcpy( &w, &v, 80 / CHAR_BIT );
std::size_t seed = 0;
boost::hash_combine( seed, w[ 0 ] );
boost::hash_combine( seed, w[ 1 ] );
return seed;
}
};
// 80 bit long double in 16 bytes
template<class T> struct hash_float_impl<T, 128, 64>
{
static std::size_t fn( T v )