On 10/12/13 13:42, Artur Skawina wrote: > template isBaseOf(BASE, C) { > static if (is(C S == super)) > enum isBaseOf = { > foreach (A; S) > static if (is(A==BASE)) > return true; > return is(C==BASE); > }(); > else > enum isBaseOf = is(C==BASE); > }
That was too verbose. template isBaseOf(BASE, C) { enum isBaseOf = { static if (is(C S == super)) foreach (A; S) static if (is(A==BASE)) return true; return is(C==BASE); }(); } artur