<div>template isThing( alias symbol, A )</div><div>{</div><div>  enum isThing = false;</div><div>}</div><div><br></div><div>This template works in most contexts:</div><div><br></div><div>int x;</div><div>struct S {}</div><div>
<br></div><div>pragma(msg, isThing!x);</div><div><div>pragma(msg, isThing!S);</div></div><div><br></div><div>But this fails:</div><div><div>pragma(msg, isThing!int);</div></div><div><br></div><div>Why does it fail on a basic type (int), but not a user defined type (S)?</div>
<div>How can I fix the template declaration to not error in that case?</div><div>I tried:</div><div><br></div><div><div>template isThing( alias symbol, A )</div><div>{</div><div>  enum isThing = false;</div><div>}</div></div>
<div><div>template isThing( T, A )</div><div>{</div><div>  enum isThing = false;</div><div>}</div></div><div><br></div><div>Hoping the T version would catch the int, but this leads to different errors "matches more than one template declaration".</div>