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