1 module beard.meta.child_of; 2 3 /// Tests if C is a subclass of P. 4 template ChildOf(C, P) { 5 static if (is(C Unused : P)) 6 enum ChildOf = true; 7 else 8 enum ChildOf = false; 9 } 10 11 /// Defines a nested Eval!C template that tests if C is a subclass of P. 12 template ChildOf(P) { 13 template Eval(C) { 14 enum Eval = ChildOf!(C, P); 15 } 16 } 17 // vim:ts=4 sw=4