Suggestion: Walter Bright, why not to implement multiple inheritance in D?

Larry Evans cppljevans at cos-internet.com
Sun Dec 10 08:32:23 PST 2006


On 12/02/2006 09:33 PM, Walter Bright wrote:
> Larry Evans wrote:
> 
>> How would the D equivalent to mpl::inherit_linearly<, inherit<,>, >
>> (see http://www.boost.org/libs/mpl/doc/refmanual/inherit-linearly.html)
>> work without using the MI class, inherit?
> 
> 
> I would suggest using instead D's ability to declare the members of a 
> struct using tuples.
Good point.

Now, I've another use of c++ MI, and I'm wondering how to do the
equivalent in D.  This use involves "dynamic inheritance" which is
somewhat like the 12.7 Delegation in Stroustrup's _Design and Evolution
of c++_.  The code is used here:

   http://preview.tinyurl.com/wwsee

The test code is in the corresponding libs/grammar_pipeline/test
directory.  One application of such dynamic inheritance was discussed
here:

   http://article.gmane.org/gmane.comp.lib.boost.devel/99421

Of course, a more concrete application was in the aforementioned
tinurl reference.

So...how would this be done in D?  Since the above application involved 
calculating grammar lookahead sets, and since you're interested in
emulating spirit in D, this might provide some further motivation
for finding a D equivalent :)



More information about the Digitalmars-d mailing list