Boost logo

Boost :

Subject: Re: [boost] [functional/hash] Interface-breaking changes to hash_combine
From: Bjorn Reese (breese_at_[hidden])
Date: 2014-07-29 07:12:56


On 07/29/2014 12:50 AM, Daniel James wrote:
> On 27 July 2014 17:07, Joaquin M Lopez Munoz <joaquin_at_[hidden]> wrote:

>> namely, seed ^= hash_value(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2),
>> is no longer followed in all cases.
>>
>> This is a backwards compatibility breach --at the very least I think it
>> should be documented.
>
> That algorithm should never have been specified in the documentation.
> I guess I overestimated myself and assumed I wouldn't do such a thing.
> I've removed it now, and added some notes.

I am using this algorithm to calculate fingerprints as described in (see
page 7)

   http://goanna.cs.rmit.edu.au/~jz/fulltext/jasist-tch.pdf

Because the hash_combine has been documented, I did not expect it to
change. As this is used in a deployed peer-to-peer network, I cannot
change the algorithm.

Fortunately I can workaround it by replacing Boost's implementation with
my own hash_combine(), but this was a near-miss that I would not have
found in time unless Joaquin pointed it out.


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