Boost logo

Boost :

Subject: Re: [boost] hash_combine vs hash_value
From: Daniel James (dnljms_at_[hidden])
Date: 2011-03-25 10:49:23


On 25 March 2011 13: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?

If you call hash_value directly you won't be taking advantage of the
mechanism for finding the correct overload. Obviously, in this case
that isn't a big deal but we'd rather encourage an implementation
style that always works. There are also some portability workarounds
that you'll be missing.

Daniel


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