using memset withing a pure function

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 14 22:50:49 PDT 2015


On Saturday, 15 August 2015 at 02:21:46 UTC, D_Learner wrote:
> Well, the actual error I got is :  Error: memset cannot be 
> interpreted at compile time, because it has no available source 
> code . I seems to suggest I miss the actual code.

I guess I gave you a wrong impression of how pure relates to CTFE 
over here: 
<http://forum.dlang.org/post/hdzhkxqgcpsuovciflxj@forum.dlang.org>. Sorry 'bout that.

There, your function wasn't pure which made CTFE impossible. But 
being pure is not enough for a function to be CTFEable. The 
source code needs to be available, too. And then there are things 
that are ok in pure functions but simply don't work in CTFE.


More information about the Digitalmars-d-learn mailing list