Boost logo

Boost :

Subject: Re: [boost] [hash] Extract module from functional + std::hash_combine
From: Peter Dimov (lists_at_[hidden])
Date: 2018-01-06 18:06:05


Vinnie Falco wrote:

> In the absence of an algorithm which allows for a seed, a less efficient
> but equally effective method is to prepend a unique value, specific to the
> instance of the hash function, to theinput data. This can be turned into a
> generic wrapper (I believe Peter will eventually add such a thing if he
> has not done so already).

I decided to require algorithms to support seeding as part of the concept
requirements. If the best an algorithm can do with that seed is to prepend
it to the value (as-if by default constructing and calling update(seed, n)),
it can do so, but usually, the algorithm can do better than that.


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