Boost logo

Boost :

From: Daniel James (daniel_at_[hidden])
Date: 2005-03-21 15:20:20


Thorsten Ottosen wrote:
> I would like to thank all who partcipated:

Thank you from me as well, and thanks to Thorsten for managing the review.

> Issues and solutions:
> ---------------------
>
> 1. for those who don't want to include the whole std-lib, individual headers
> can be put in hash/std/XX.hpp (but see 3)

This should probably be a sub-directory of functional, as hash lives at
boost/functional/hash.hpp.

> 4. avoid too many zero hash values by defaulting to something other than 0

I think the preferred solution was to add a constant to hash_combine
(which seems to work well). Although, it might be good to have an
'initial_seed' constant.

> 5. change implementation of hash values for pointers so undefined behavior is
> gone (and consider adding x + (x >> 3) )

I'm going to do that.

> 6. the design aim was predictibility and to minimize collision; for the latter
> part, I
> would like to know if similar values hash to similar buckets or not. If
> very different
> objects end up in the same buskets, wouldn't equality be much faster
> rejected?
> Should this be a concern?

Generally, values that collide should not be similar, (which is why
collisions of sequences of zeros was a problem), although I'm sure that
there are still exceptions to that rule. Especially because it's quite
hard to define what 'similar' means in general.

Daniel


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