http://d.puremagic.com/issues/show_bug.cgi?id=2565


Andrej Mitrovic <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]


--- Comment #6 from Andrej Mitrovic <[email protected]> 2013-02-04 
17:42:55 PST ---
(In reply to comment #5)
> but the means should be explicit.

This could be implementable via a mixin template, similar to how forwarding
constructors were proposed in Issue9066. A general-purpose template could be
written which could be used via:

mixin Forward!(BaseClass, "funcName");

And another template which uses it to fix this issue with:

class Foo : public FooImpl, public IFoo
{
    mixin ImplementInterface!(IFoo, FooImpl);

    // which expands to:
    mixin Forward!(FooImpl, "foo");
    mixin Forward!(FooImpl, "bar");

    // which expands to:
    override int foo() { return FooImpl.foo(); }
    override int bar() { return FooImpl.bar(); }
}

Internally it would iterate through all IFoo interface functions and find the
matching implementations in FooImpl, and use `Forward` to mixin in a forwarding
function.

Or we would have language support. Anyway it should be doable as a library
solution for the time being.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to