Boost logo

Boost :

Subject: Re: [boost] hash_combine vs hash_value
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-25 11:42:53


AMDG

On 03/25/2011 08:32 AM, Michael Goldshteyn wrote:
> The xor'ing of the first value doesn't bother me, but this displacement
> by 0x9e3779b9 of the first value does, since for 32-bit size_t values,
> we've just lost a bunch of info. It seems like the formula will result
> in less of the first value being applied to the overall hash, due to the
> "potential" unsigned 32-bit overflow caused by the addition. Maybe I'm
> misinterpreting the effect. If so, please correct me.
>

You won't lose anything. Unsigned addition
wraps around.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk