Templates with strings
    Ali Çehreli 
    acehreli at yahoo.com
       
    Sun Jul  4 00:34:00 PDT 2010
    
    
  
Mike Linford 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?
There is relatively detailed information on what types of functions can 
be called at compile time:
   http://www.digitalmars.com/d/2.0/function.html#interpretation
<quote>
In order to be executed at compile time, the function must appear in a 
context where it must be so executed, for example:
     * initialization of a static variable
     * dimension of a static array
     * argument for a template value parameter
</quote>
Ali
    
    
More information about the Digitalmars-d-learn
mailing list