compile-time explicitness

Gor F. Gyolchanyan gor.f.gyolchanyan at gmail.com
Fri Sep 23 11:47:32 PDT 2011


Of course, if the entire D gets CTFE-able, the __ctfe will be completely useless.
But i can't see that coming for a long time. Most of the major programming
problems are best solved with classes and that's where CTFE stops.

About templates:

void unpackIntoFunction(alias arrayOfVariants, alias func)()
{
   // you can't generate the necessary mixin strings right here, because it won't
be compile-time.
   // you need to create a separate function, that returns the required string to
be mixed in.
   mixin(whatIJustGenerated);
}


More information about the Digitalmars-d mailing list