This is solved through simple inheritance constraints and aliasing with qualification.


class X;
class subfoo;
class subbaz : subfoo;
class foo(T) if (is(T : subfoo)) X;
class baz(T) if (is(T : subbaz)) foo!T;

then when we need foo with "default",

alias foo = qualified.foo!subfoo;

Without the qualification, which I guess requires having this stuff in a separate module, there is no conflict. alias foo = foo!subfoo; fails circularly.







Reply via email to