On 26 November 2012 18:40, 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">On Monday, 26 November 2012 at 16:37:08 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Why does it fail on a basic type (int), but not a user defined type (S)?<br>
</blockquote>
<br></div>
S is a D symbol name, int isn't...<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
How can I fix the template declaration to not error in that case?<br>
</blockquote>
<br></div>
Try using only the (T,A) version, removing the alias version.<br>
<br>
You might have to pass typeof(var) to it in some cases, but if you pass it typenames it should just work.<br>
</blockquote></div><br></div><div class="gmail_extra">The template works on symbol aliases, so I can't do that. It needs to gracefully handle being given an int though somehow.</div>