Best interface for memcpy() (and the string.h family of functions)

Stefanos Baziotis sdi1600105 at di.uoa.gr
Thu May 30 00:18:06 UTC 2019


On Wednesday, 29 May 2019 at 20:50:45 UTC, kinke wrote:
>
> ref would only work when copying one instance at a time. Many 
> times, you'll want to copy a contiguous array of a length only 
> known at runtime (and definitely NOT invoke memcpy in a loop, 
> so that the implementation can e.g. use SIMD streaming when 
> copying gazillions of 32-bit pixels).
>

The current state is that we think that slices should be enough 
for this need.
Meaning, you don't need the third size parameter. In this case, 
ref is better. On the other, in other cases I think that pointers
are more intuitive. Again, of course the fact that _I_ think it 
is of little importance. That post was primarily made so that 
you, the community, can give
feedback on this.

Apart from that, I'm still sceptical about whether we should 
provide
a version with size..


More information about the Digitalmars-d mailing list