Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2005-03-13 11:49:22


Daniel James wrote:
> Dave Harris wrote:
>
>> For example, the proposal has no specialisation for chars at all. I
>> can't tell if that is an oversight, or whether it is a design aim
>> that: char chars[] = { 1, 2, 3, 4 };
>> int ints[] = { 1, 2, 3, 4 };
>>
>> assert( hash_range( chars, chars+4 ) == hash_range( ints, ints+4
>> ) );
>
> I don't think it's either. Peter?

Sequences of the same values produce the same hash value by design.

In a language where character values are different from integer values this
would not imply char[] and int[] compatibility, of course, but a C++ "char"
is not necessarily a character, and "unsigned int" is not necessarily a
non-character.


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