Filters all the members of a type based on a provided predicate
The predicate takes two parameters - the first is the type, the second is the string name of the member being iterated on.
import std.meta: AliasSeq; struct S { int i; float f; int i2; short s; } enum hasInt(T, string name) = is(typeof(__traits(getMember, T, name)) == int); static assert(FilterMembersOf!(S, hasInt) == AliasSeq!("i", "i2"));
See Implementation
Filters all the members of a type based on a provided predicate
The predicate takes two parameters - the first is the type, the second is the string name of the member being iterated on.