Suggestion: Walter Bright, why not to implement multiple inheritance in D?
BCS
BCS at pathilink.com
Sat Dec 2 13:19:10 PST 2006
Walter Bright wrote:
> Burton Radons wrote:
>> As an aside to Walter, I stumbled on a solution to the multiple vtable
>> problem a couple years ago. Instead of putting the vtable in the
>> object, you put it in the reference, like with a delegate. Then if an
>> object is posing as a base type, you just select an appropriate vtable
>> and offset the pointer.
>
> That is a good idea.
That is how I think interfaces should work.
It has a whole host of cool implications: interfaces from structs,
functions, on-the-fly literals or wherever delegates can be done. Make a
.tupleof for interfaces, and a template could even build one.
(I'll get off of my soap box now) <g>
More information about the Digitalmars-d
mailing list