memcpy, memset, memcmp and friends in the D Runtime

Steven Schveighoffer schveiguy at yahoo.com
Mon Apr 7 05:38:55 PDT 2014


On Mon, 07 Apr 2014 07:51:38 -0400, Mike <none at none.com> wrote:

> * Were these methods intentionally omitted from the D Runtime, or just  
> taken for granted since they were so conveniently available in the C  
> standard library?

I don't think it's convenience so much as being very experienced and tuned  
functions.

> * Should they be added to core.memory or some other module and exposed  
> as official, supported, methods of the D Runtime (hopefully changing  
> their names)?

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


More information about the Digitalmars-d mailing list