forcing compile time function execution
Joshua Reusch
yoschi at arkandos.de
Tue Dec 27 11:31:57 PST 2011
Am 27.12.2011 18:59, Artur Skawina wrote:
> Is there a way to *force* CTFE? Without using an extra wrapper like this:
>
> auto f_impl(alias a)() { / * ... ctfeable ... */ }
> auto f(alias a)() { enum ctfed = f_impl!a; return ctfed; }
>
> A "@compile" (or "@ctfe" etc) function attribute would eliminate the need for the wrapper...
>
> artur
more general: is there any reason to not evaluate a pure function with
const arguments always at compile-time ?
More information about the Digitalmars-d
mailing list