Interface factory

luke lukas.laedrach at bluewin.ch
Tue Aug 14 10:07:19 PDT 2007


What about casting an interface to another?

Like:

interface A{}
interface B: A{}
class C : B{}

B Factory()
{
 return new C();
}


auto i = cast(A)Factory();

Could this work?


More information about the Digitalmars-d-learn mailing list