Interface abstraction

Frustrated c1514843 at drdrb.com
Tue Dec 31 16:31:02 PST 2013


If I use interfaces instead of classes is there a way to have new 
return the underlying interface that I want it to?


interface A { }
class B : A {}

auto a = new B; // should return cast(A)(new B);

Maybe it's not such a big deal though? (I can't think of any case 
where a being of type B will hurt since it is always implicitly 
castable to type A.


More information about the Digitalmars-d-learn mailing list