CTFE in imported static initializers

Steven Schveighoffer schveiguy at gmail.com
Tue May 14 10:21:23 UTC 2019


On 5/14/19 10:25 AM, Bastiaan Veelo wrote:
> On Monday, 13 May 2019 at 20:39:57 UTC, Steven Schveighoffer wrote:
>> Why? I can't even use it at compile time...
>>
>> pragma(msg, moddata.length);
> 
> Is that a good test or "usable at compile time", though? Isn't 
> pragma(msg) done at an earlier stage than CTFE? I think that was the 
> argument for ctfeWriteln.

No, pragma(msg) can happen after CTFE:

pragma(msg, buildModData()[0 .. 100]);

> 
> (We both know that I'm out of my league here, but anyway :))

Well, this is the learn forum, I too am out of my league when it comes 
to what's valid here ;)

-Steve


More information about the Digitalmars-d-learn mailing list