On 26 November 2012 19:06, Manu <span dir="ltr"><<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@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=""><div class="h5">On 26 November 2012 18:49, jerro <span dir="ltr"><<a href="mailto:a@a.com" target="_blank">a@a.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><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>
If you want to have a template parameter that can be anything, including a a symbol or a built in type, you can use this ugly workaround:<br>
<br>
template foo(bar...) if(bar.length == 1)<br>
{<br>
    enum foo = 1;<br>
}<br>
</blockquote></div><br></div></div></div><div class="gmail_extra">Ahhhhh, that explains why 90% of std.traits is written in that super-weird way! I always wondered what that was all about.</div><div class="gmail_extra"><br>
</div><div class="gmail_extra">
When you say 'anything' though, does that include alias parameters? Will bar[0] be the equivalent of template foo(alias bar) if called with a symbol?</div>
</blockquote></div><br></div><div class="gmail_extra">Ummm, immediate problem. That interferes with my argument list, inhibits consecutive parameters. You'll notice my template had 'A' on the end... it would make for a horrible API if the second arg were to come first in this case... is that the only option?</div>