isEnum

Aliases itself to whether or not a type is an enum.

For use with std.meta.Filter, std.traits.allSatisfy and similar, which cannot take is() expressions.

  1. template isEnum(T)
    template isEnum (
    T
    ) if (
    isType!T
    ) {
    enum isEnum;
    }
  2. template isEnum(alias T)

Examples

enum E { a, b, c }

static assert( isEnum!E);
static assert(!isEnum!int);
static assert(!isEnum!string);