Tell compiler not to try and CTFE template?

Jethro via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Apr 10 18:53:07 PDT 2017


I have a template that that takes no arguments. It takes a while 
to compile, but if I simply create a dummy argument, D compiles 
much quicker.

e.g.,

void foo(string s)(); // slow,

void foo(string s)(int x); // fast. (I, of course, pass a dummy 
value for x)

This is because the compiler doesn't try to evaluate foo as a 
CTFE.

I'd like inform it not to do this in the first place.



More information about the Digitalmars-d-learn mailing list