On Saturday, 5 November 2016 at 13:34:51 UTC, Gianni Pisetta
wrote:
When i have time i will test it with ldc and see if the result
is the same, then it will probably be a front-end bug and i
will report it as an issue.
Indeed, I've been fighting against that since a few minutes. We
cant select the Base of an eponymous template.
template isEponymousTemplate(T)
{
static if (is(T == class) || is(T == interface) || is(T ==
struct) || is(T == union))
{
enum p = __traits(parent, T).stringof == T.stringof;
enum isEponymousTemplate = p && isTemplateInstance!T;
}
else
enum isEponymousTemplate = false;
}
template TemplateBase(T : Base!Args, alias Base, Args...)
if (is(T == class) || is(T == interface) || is(T == struct) ||
is(T == union))
{
alias TemplateBase = Base;
}