<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 18, 2018 at 1:25 PM berni via Digitalmars-d-learn <<a href="mailto:digitalmars-d-learn@puremagic.com">digitalmars-d-learn@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Is there a way to check if a function is indeed executed at <br>
compile time or not? (Other than going through the whole <br>
executable binaries...)<br>
<br>
I tried<br>
<br>
> static this()<br>
> {<br>
>   if (__ctfe) pragma(msg,"works");<br>
>   // some other stuff<br>
> }<br>
<br>
but unfortunatley this "if" is also executed at compile time, <br>
when I put it into a function that is only called at runtime. <br>
When I try "static if" instead the compiler complains about <br>
"__ctfe" being not known at compile time.<br></blockquote><div><br></div><div>You could use __ctfeWrite</div><div><br></div><div>But it seems __ctfe does not work anymore</div><div><br></div><div><a href="https://run.dlang.io/is/snckyV">https://run.dlang.io/is/snckyV</a> </div></div></div></div></div></div>