On Monday, 7 April 2014 at 12:38:55 UTC, Steven Schveighoffer wrote:
I think using using D's safer syntax of

a[] = b[]

and

a[] = 0;

Is much preferable to using memcpy/memset directly.

They should do the "Right Thing", including calling memcpy/memset when correct.

-Steve

I received a very informative answer on D.learn (http://forum.dlang.org/post/xdnbfbdvruevjgqvb...@forum.dlang.org) that describes why a function that copies memory still may be needed:

"Depending on the type being copied, "a[] = b[]" is not straight
up "memory copy" it's the actual full assignment, with postblit
and all. That's why the call we want is *really* memcpy."

So, my question remains: If I'm porting D to a platform that has no C library, shouldn't a public, supported function that copies memory be added in the D Runtime?

Reply via email to