let's say I have:

```d
class Base
{
    int f()
    {
        doSomething();
        return n * 5;
    }

    void doSomething() { }
}

class Foo : Base
{
    void myMethod() { /* ... */ }
}

class Baa : Base
{
    void myMethod2() { /* ... */ }
}
```

then I'd like to make a extended version(making those DRY routines a class itself) of Foo and Baa, like this:

```d
abstract class DRY : Base
{
    this(int n)
    {
        this.n = n;
    }

    override int f()
    {
        super.doSomething();
        return n;
    }

    private int n;
}
```

but the class ExtendFoo and ExtendedBaa must inherit from Foo and Baa, respectively. But how can I make it inherit the routines from DRY class too without multiples inheritance? in C++ I'd just do:

```d
class ExtendedFoo : DRY, Base { /* ... */ }
class ExtendBaa : DRY, Base { /* ... */ }
```

Reply via email to