Reference to implementation of interface.

Pragma ericanderton at yahoo.removeme.com
Fri Jan 19 13:41:55 PST 2007


Christian Aistleitner wrote:
> Hello,
> 
> I am in need of a way to reference the class implementing an interface 
> from within the interface's definition.

Offhand, I'd say the best way to do that is with a templated base-class or interface.  For example:

interface Bar(T){
     static T baz; // in the class below, 'baz' will by of type 'Foo'
}

class Foo: Bar!(Foo){
}

-- 
- EricAnderton at yahoo


More information about the Digitalmars-d-learn mailing list