|
Boost : |
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-12-06 16:55:47
On 12/6/24 19:51, Claudio DeSouza via Boost wrote:
>>
>> I think, the answer to memory safety won't be the span as the argument
>> type, which will only get in the way in the hasher implementation, but a
>> markup of the pointer+size arguments so that the compiler is able to
>> reason about the buffer size anyway. I think, MSVC and gcc already have
>> attributes of that kind, though I'm not sure what exactly the compilers
>> are able to do with them. Maybe, those attributes need to be
>> standardized instead of pushing span everywhere.
>>
> It depends what you mean by this, but span already offers compile time
> fixed extants, that can be used with generic algorithms and entirely elide
> the runtime checks, if you want to support that type of generic construct.
I don't think fixed extents are applicable to the hasher interface.
And fixed extents are not as useful as the dynamic extent in general, in
my experience, as most of the time we deal with variable-sized sequences.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk