<div class="gmail_quote">On Sun, Jul 4, 2010 at 09:34, Ali Çehreli <span dir="ltr">&lt;<a href="mailto:acehreli@yahoo.com" target="_blank">acehreli@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div>Mike Linford wrote:<br>
<br>
&gt; 2. The reason I don&#39;t use CTFE is because I don&#39;t know how to be certain<br>
&gt; its been called at compile time. Apparently using a result in a template<br>
&gt; like you did will accomplish that, but is there a way I can be sure<br>
&gt; without making up bogus empty templates?<br>
<br></div>
There is relatively detailed information on what types of functions can be called at compile time:<br>
<br>
  <a href="http://www.digitalmars.com/d/2.0/function.html#interpretation" target="_blank">http://www.digitalmars.com/d/2.0/function.html#interpretation</a><br>
<br>
&lt;quote&gt;<br>
In order to be executed at compile time, the function must appear in a context where it must be so executed, for example:<br>
<br>
    * initialization of a static variable<br>
    * dimension of a static array<br>
    * argument for a template value parameter<br>
&lt;/quote&gt;<font color="#888888"><br></font></blockquote><div><br><br>And, traditionally, being defined as an enum (a C/C++ inheritance?)<br><br>enum thingy = funToBeTested();<br><br>If it compiles, then funToBeTested works at compile-time.<br>
<br>Is there not a __ctfe trait or somesuch?<br><br>Philippe<br></div></div>