|
Boost : |
From: Ivan Matek (libbooze_at_[hidden])
Date: 2024-12-03 21:11:26
On Tue, Dec 3, 2024 at 10:07â¯PM Vinnie Falco <vinnie.falco_at_[hidden]> wrote:
> On Tue, Dec 3, 2024 at 12:09â¯PM Peter Dimov via Boost <
> boost_at_[hidden]> wrote:
>
>> pair<string, string>( "foo", "bar" )
>> pair<string, string>( "foob", "ar" )
>> pair<string, string>( "fooba", "r" )
>>
>
> But....but... in each of these cases where there are two strings, the
> strings also submit their size after the data, thus these would not be
> equivalent:
>
> { "foo", 3, "bar", 3 }
> { "foob", 4, "ar", 2 }
> { "fooba", 5, "r", 1 }
>
> Or am I missing something?
>
> Thanks
>
Yes, currently it works fine(as you described). Peter was using that as an
example why we add size of range when hashing. To avoid collisions like
this. I was basically asking why hash_append of span<char> also hashes
span size since I expected it just consume the bytes span points to.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk