On 26 November 2012 21:15, David Nadlinger <span dir="ltr"><<a href="mailto:see@klickverbot.at" target="_blank">see@klickverbot.at</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:18:28 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
the supplementary question is, how do I then<br>
discover if bar[0] is a symbol or not? I can't see any traits to test for<br>
builtin types...<br>
</blockquote>
<br></div>
Depends on your definition of symbol, but if you mean symbol as in "an alias parameter accepts it", the obvious solution is:<br>
<br>
---<br>
template isSymbol(alias S) {<br>
  enum isSymbol = true;<br>
}<br>
<br>
template isSymbol(S) {<br>
  enum isSymbol = false;<br>
}<br>
---<br>
<br>
David<br>
</blockquote></div><br></div><div class="gmail_extra">struct S {}</div><div class="gmail_extra">isSymbol!S <- why isn't this ambiguous? both templates match that equally, why would it prefer the alias one?</div>