Multiple Inheritance of Classes

superdan super at dan.org
Wed Aug 13 06:46:02 PDT 2008


Yigal Chripun Wrote:

> superdan wrote:
> > Yigal Chripun Wrote:
> > 
> >> About your first thought: can you compare your (C++ templates)
> >> solution with D mixins? why would I choose that approach instead of
> >> template mixins if it's only good for inheritance of
> >> implementation? I think (and I'm sure you'll correct me if I'm
> >> wrong) that mixins remove the need for that pattern entirely.
> > 
> > how would the mixin solution look like?
> 
> I've attached a file with a sample solution with mixins. you can put
> both mixins in the most derived class or put one inside the other  (as
> it is now)

got it. the question was how does that compare to stacked templates. guess they've about the same power. tho i suggest u move mixin B_impl outta B_impl and into A_and_B. why force A_impl as a bundle deal for B_impl.



More information about the Digitalmars-d mailing list