I made a compromise:

[code]
import std.stdio;

interface Transformable {
public:
        void transform();
}

mixin template Transform() {
public:
        this() {
                writeln("Transform Ctor");
        }

        void transform() {
                writeln("transformiere");
        }
}

abstract class Drawable {
public:
        void draw() {
                writeln("zeichne");
        }
}

class Shape : Drawable, Transformable {
public:
        mixin Transform;

        this() {
                writeln("Shape CTor");
        }
}

void test_drawable(Drawable d) {
        d.draw();
}

void test_transformable(Transformable t) {
        t.transform();
}

void main() {
        Shape s = new Shape();

        test_drawable(s);
        test_transformable(s);
}
[/code]

Any suggestions?

Reply via email to