On 26 November 2012 19:38, Adam D. Ruppe <span dir="ltr"><<a href="mailto:destructionator@gmail.com" target="_blank">destructionator@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Monday, 26 November 2012 at 17:30:46 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Error: variable isProperty cannot be read at compile time<br>
</blockquote>
<br></div>
This is easy now that I see the code:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
template isProperty( T )<br>
{<br>
bool isProperty = false;<br>
}<br>
</blockquote>
<br>
<br></div>
That should be enum bool isProperty = false. The enum is important because that makes it a compile time value, instead of a runtime variable like regular "bool isProperty".<br>
<br>
Generally if you want something at compile time, enum is the magic keyword to put before an otherwise normal variable declaration.<br>
<br>
Fix that in both places you did it... and import std.traits of course, and your code compiles.<br>
<br>
Not sure if it is right, but it compiles and spits a bunch of output.<br>
</blockquote></div><br></div><div class="gmail_extra">Actually, look back in the thread, I blindly copied that from you! ;) .. Yes, if obviously should have been enum.</div>