
6 Dec
2024
6 Dec
'24
4:51 p.m.
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. Claudio.