[functional/hash] Interface-breaking changes to hash_combine
Hi, There's been a number of internal changes to the implementation of boost::hash_combine during this year, with the result that the documented procedure: http://www.boost.org/doc/html/hash/reference.html#boost.hash_combine 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. Best, Joaquín M López Muñoz Telefónica
On 27 July 2014 17:07, Joaquin M Lopez Munoz
Hi,
There's been a number of internal changes to the implementation of boost::hash_combine during this year, with the result that the documented procedure:
http://www.boost.org/doc/html/hash/reference.html#boost.hash_combine
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.
On 07/29/2014 12:50 AM, Daniel James wrote:
On 27 July 2014 17:07, Joaquin M Lopez Munoz
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.
participants (3)
-
Bjorn Reese
-
Daniel James
-
Joaquin M Lopez Munoz