using memset withing a pure function

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 14 18:13:01 PDT 2015


On Saturday, 15 August 2015 at 01:09:15 UTC, D_Learner wrote:
> When writting a pure fucntion involving C non pure functions 
> like
>  memcpy() and   memset()

Those functions are pure already, and marked so in the newest dmd 
(and I think older ones too, though I haven't confirmed.

Your code compiled out of the box for me.

BTW D also has some syntax sugar for them:

arr[start .. end] = 0; // memset those bounds to 0
arr[start .. end] = arr2[start .. end]; // memcpy


More information about the Digitalmars-d-learn mailing list