I've got this code duplicated in quite some functions: --------------------- foreach (member; __traits(derivedMembers, API)) { // Guards against private members static if (__traits(compiles, __traits(getMember, API, member))) { static if (isSomeFunction!(__traits(getMember, API, member)) && !hasUDA!(__traits(getMember, API, member), IgnoreUDA) && !isSpecialFunction!member) { alias overloads = MemberFunctionsTuple!(API, member);
foreach (MethodType; overloads) { // function dependent code here } } } } -------------------- What's the idiomatic way to refactor / reuse this code fragment? -- Johannes