A little of Partial Compilation
Walter Bright
newshound1 at digitalmars.com
Wed Aug 20 00:47:52 PDT 2008
Don wrote:
> Note that even if all parameters to a function are known at compile
> time, doesn't mean it's sensible to run it at compile time. (Example:
> calculating pi to fifty billion decimal places). The programmer needs to
> annotate it somehow to tell the compiler that is suitable for compile time.
It's one of those impossible problems for the compiler to predict if it
should attempt to execute a function at compile time or not. That's why
compile time function evaluation is initiated with a specific syntax,
rather than tried in general.
More information about the Digitalmars-d
mailing list