diff --git a/include/boost/container_hash/hash.hpp b/include/boost/container_hash/hash.hpp index c52cd6b..f245642 100644 --- a/include/boost/container_hash/hash.hpp +++ b/include/boost/container_hash/hash.hpp @@ -150,7 +150,24 @@ namespace boost } }; - // 80 bit long double + // 80 bit long double in 12 bytes + template struct hash_float_impl + { + 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 struct hash_float_impl { static std::size_t fn( T v )