Templates with strings

Simen kjaeraas simen.kjaras at gmail.com
Sat Jul 3 23:52:51 PDT 2010


Mike Linford <mike.linford.reg at gmail.com> wrote:

> 2. The reason I don't use CTFE is because I don't know how to be certain
> its been called at compile time. Apparently using a result in a template
> like you did will accomplish that, but is there a way I can be sure
> without making up bogus empty templates?

Anything that is static, that is, static member variables, globals with
initializers, and enums, will be CTFE'd. An enum is probably the best
match for you.

-- 
Simen


More information about the Digitalmars-d-learn mailing list