Boost logo

Boost :

From: Alexander Grund (alexander.grund_at_[hidden])
Date: 2024-12-05 13:03:59



Am 05.12.24 um 13:55 schrieb Peter Dimov via Boost:
> Alexander Grund wrote:
>> But you are currently defining the interface of the hash algorithms:
>> constexpr void update( unsigned char const* data, std::size_t n );
>> My proposal is to define it as e.g.
>> constexpr void update(span<unsigned char const>);
> Which span is that, though?
I left that open to the "chosen span library" I referenced belowor a
template that accepts a span-like type.
>> Even if we could assume C++20 and std::span, the interface taking
>> std::span<unsigned char const> is inferior in usability to the current
>> approach because it doesn't work well for ranges of `char` or `byte`.
I copied that from the source and missed it in the documentation.
So span<void const> then or as that isn't accepted span<char const>
assuming sizeof(char)==sizeof(byte)
> I'm not sure what this means. hash_append already accepts spans and
> ranges, and is type safe.
My bad, sorry for not double-checking.



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