how to detect ctfe

Philpax via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat May 31 23:01:11 PDT 2014


__ctfe can be used for this purpose:

"The __ctfe boolean pseudo-variable, which evaluates to true at 
compile time, but false at run time, can be used to provide an 
alternative execution path to avoid operations which are 
forbidden at compile time. Every usage of __ctfe is evaluated 
before code generation and therefore has no run-time cost, even 
if no optimizer is used." ( http://dlang.org/function.html )


More information about the Digitalmars-d-learn mailing list