Classes. C++ to D
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun May 3 11:17:25 PDT 2015
I'd make class A and class B into mixin templates instead.
mixin template A {
string a() { return "foo"; }
}
mixin template B {
string b() { return "bar"; }
}
class C {
mixin A;
mixin B;
}
If you still need class A and class B, just make a class that
mixes in the template for them too.
Since the C++ methods aren't virtual, I imagine you don't really
need a base class for them, but if you do want a virtual base
class, make interfaces and inherit from as many of them as you
need.
More information about the Digitalmars-d-learn
mailing list