Boost logo

Boost :

Subject: Re: [boost] hash_combine vs hash_value
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2011-03-25 22:26:28


On Fri, Mar 25, 2011 at 06:57, Michael Goldshteyn
<mgoldshteyn_at_[hidden]> wrote:
> After reading the explanation of how hash_combine should be used, I am left
> wondering. Why is the recommendation for hash_combine different from what
> one would intuitively expect?
>

With combine, you can also use a non-zero initial value, so Point(x,y)
and BoundingBox(x,y) don't have the same hash, if you happen to mix
types in your tables.


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