Function to delegate conversion

Kirk McDonald kirklin.mcdonald at gmail.com
Sun Jun 25 01:04:14 PDT 2006


Kirk McDonald wrote:
> Without the ability to convert fn into a delegate to a.foo, implementing 
> this class-wrapping functionality is all but impossible.

Okay, that IS a bit of hyperbole. I can easily do it with wrappers:

class A {
     void foo() { }
}

void A_foo(A a) {
     a.foo();
}

// Then wrap A_foo and pass the object as the first arg...

But this imposes a bit of a burden on the user.

-Kirk McDonald



More information about the Digitalmars-d mailing list