On Sun, 24 Jun 2018 14:43:09 +0000, Mr.Bingo wrote:

> let is(CTFE == x) mean that x is a compile time constant. CTFE(x)
> converts a x to this compile time constant. Passing any compile time
> constant essentially turns the variable in to a compile time
> constant(effectively turns it in to a template with template parameter)
> 

You can use __ctfe:

static if (__ctfe) {
    // compile-time execution
} else {
    // run-time execution
}

Reply via email to