xxxxxxxxxx
import std.stdio;
interface Abstract1 {
/* virtual */ void overrideMe1();
void sayHello();
mixin template Abstract1Impl() {
void sayHello() { import std.stdio; writeln("Hello"); }
}
}
interface Abstract2 {
/* virtual */ void overrideMe2();
void sayGoodbye();
mixin template Abstract2Impl() {
void sayGoodbye() { import std.stdio; writeln("Goodbye"); }
}
}
class MyClass : Abstract1, Abstract2 {
mixin Abstract1Impl;
mixin Abstract2Impl;
override void overrideMe1() { writeln("overrode 1"); }
override void overrideMe2() { writeln("overrode 2"); }
}
void main() {
auto it = new MyClass();
it.sayHello();
it.sayGoodbye();
it.overrideMe1();
it.overrideMe2();
}