How to enforce compile time evaluation (and test if it was done at compile time)

sarn via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Feb 27 16:22:28 PST 2017


On Tuesday, 28 February 2017 at 00:20:05 UTC, sarn wrote:
> On Monday, 27 February 2017 at 19:26:06 UTC, Christian Köstlin 
> wrote:
>> How can I make sure, that the calculations are done at compile 
>> time?
>
> If you ever have doubts, you can always use something like this 
> to check:
>
> assert (__ctfe);

Sorry, "enforce" would more appropriate if you're really checking.


More information about the Digitalmars-d-learn mailing list