there is no __traits(isEnum, ...) I've tried foreach(m; __traits(allMembers, ...) { static if (__traits(compiles,EnumMembers!(m))) static if (EnumMembers!(m).length) static if(is(m== enum)) } I can detect static functions with __traits(isStaticFunction, ...)