On 26 November 2012 18:40, Adam D. Ruppe <destructionator@gmail.com> wrote:
On Monday, 26 November 2012 at 16:37:08 UTC, Manu wrote:
Why does it fail on a basic type (int), but not a user defined type (S)?

S is a D symbol name, int isn't...


How can I fix the template declaration to not error in that case?

Try using only the (T,A) version, removing the alias version.

You might have to pass typeof(var) to it in some cases, but if you pass it typenames it should just work.

The template works on symbol aliases, so I can't do that. It needs to gracefully handle being given an int though somehow.