That's a strange way of testing. You can use:

```D
template Base(E)
{
    static if(is(E B == enum))
        alias Base = B;
}

static assert(is(Base!Elong == long));
static assert(is(Base!Edouble == double));
static assert(is(Base!Efloat == float));
static assert(is(Base!EEfloat == Efloat));
static assert(is(Base!ES == S));
```

However I think an even better approach is to iterate through all known fundamental types and test them in sequence:

```D
void main()
{
    template Tuple(T...) { alias Tuple = T; }

    template Base(E)
    {
        static if(is(E B == enum))
            alias Base = B;
    }

    struct S { }
    class C { }

    template GetEnum(T)  // avoid duplicate enum definition in scope issue
    {
        enum GetEnum { v = T.init }
    }

    foreach (Type; Tuple!(char, wchar, dchar, byte, ubyte,
                          short, ushort, int, uint, long,
                          ulong, float, double, real, S, C))
    {
        static assert(is(Base!(GetEnum!Type) == Type));
    }
}
```