I ran accross the following code in phobos std.array:
void trustedMemcopy(T[] dest, T[] src) @trusted
{
assert(src.length == dest.length);
if (!__ctfe)
memcpy(dest.ptr, src.ptr, src.length * T.sizeof);
else
{
dest[] = src[];
}
}
Why two different implementations for copying memory (i.e. memcpy
vs. dest[] = src[])? Why not use dest[] = src[] exclusively.
Thanks for the help, Mike
