Boost logo

Boost :

Subject: Re: [boost] [hash] Extract module from functional + std::hash_combine
From: Howard Hinnant (howard.hinnant_at_[hidden])
Date: 2017-12-19 17:10:03

On Dec 19, 2017, at 12:01 PM, Peter Dimov via Boost <boost_at_[hidden]> wrote:
> Daniel James wrote:
>> > The alternatives proposed by Howard Hinnant and by Google are better.
>> IIUC the Josuttis paper is intended as a stop-gap that won't get in the way of a better proposal.
> But it does get in the way, because the Google proposal has hash_combine with different semantics.

The name “hash_combine” was discussed in the LEWG. When I asked, I was told the functionality was the same or essentially the same as boost::hash_combine. Therefore I recommended that the standard keep the name hash_combine for this proposal as it is already well-known, and would serve as a clearer warning about what this functionality will (and will not) do.

If new functionality is to be provided which allows any algorithm to be incrementally updated with data, and then finalized to compute a hash, in such a way that the integrity of the hash algorithm is not compromised simply because it isn’t fed all the data at one time, I believe we need a new name (other than hash_combine). Otherwise there will be confusion. I chose hash_append for that new name. There may be other better names. But hash_combine is already taken and should not be reused for this purpose.


Boost list run by bdawes at, gregod at, cpdaniel at, john at