Detect runtime vs ctfe?

Nick Sabalausky a at a.a
Sat Nov 28 14:55:17 PST 2009


Is there an idiom, preferably D1, to detect whether or not the code is 
currently executing as a ctfe?

Ie:

void foo()
{
    (static?) if( ???? )
    {
        // Run-time code here
        // that does stuff the CTFE engine chokes on
    }
    else
    {
        // CTFE code here
        // that might not be ideal, but at least works as CTFE
    }
}




More information about the Digitalmars-d-learn mailing list