module ecs.traits; import std.traits; bool isForeachDelegateWithTypes(DG, Types...)() { return is(DG == delegate) && is(ReturnType!DG == int) && is(Parameters!DG == Types); } unittest { assert(isForeachDelegateWithTypes!(int delegate(int, int), int, int)); assert(isForeachDelegateWithTypes!(int delegate(ref int, ref int), int, int)); assert(!isForeachDelegateWithTypes!(int delegate(double), int, int)); }