
Giovanni Piero Deretta wrote:
On Sat, Apr 19, 2008 at 5:30 PM, Bo Persson <bop@gmb.dk> wrote:
Giovanni Piero Deretta wrote:
On Fri, Apr 18, 2008 at 5:34 PM, Matt Doyle <mdoyle@a-m-c.com> wrote:
[mailto:boost-bounces@lists.boost.org] On Behalf Of Giovanni Piero Deretta
Changing:
inline std::size_t float_hash_impl(float v) { boost::uint32_t* ptr = (boost::uint32_t*)&v; std::size_t seed = *ptr; return seed; }
to
inline std::size_t float_hash_impl(float v) { std::size_t seed; std::memcpy(&x, &v, sizeof(x)); return seed; }
/x/seed/ ??
Yes, of course :)
And also assuming that sizeof(seed) ==sizeof(float) ?
Yes, but, as the code is only compiled in when under X86, you can safely assume that.
Ok, I though it was used for x86_64 as well, but I might be wrong. Bo Persson