On Saturday, 22 June 2013 at 23:03:17 UTC, Dicebot wrote:
http://dpaste.1azy.net/22d5eee2------------------------------------ import std.traits; template getTemplate(T) { static if (is(T == TI!TP, alias TI, TP))
alias! Of course!
{
alias getTemplate = TI;
}
else
static assert (false);
}
Replacing the static if with template specialization makes it shorter:
template getTemplate(T : TI!TP, alias TI, TP)
{
alias getTemplate = TI;
}
