|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2024-12-06 16:55:45
Andrey Semashev 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.
Microsoft has tried these sorts of annotations pretty extensively, and they
have moved towards requiring span.
(In C they still need to rely on the annotations, of course, but in C++ code,
they now prefer span.)
std::span has actually been proposed by Microsoft, on the basis of that
experience.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk