foreach(m; __traits(allMembers, ...) { static if(is(m== enum)) }
That's close but not quite there... try static if(is(typeof(__traits(getMember, Item, m)) == enum))for member variables, or if you are looking at a type itself youcan leave off the typeof() bit.