"multi morphic" classes

BCS BCS at pathlink.com
Thu May 1 17:27:21 PDT 2008


Russell Lewis wrote:
> I apologize if I'm missing some subtlety, but it seems to me that this 
> would be pretty straightforward...
> 
> How about just building a class by hand using a struct?  You declare  a 
> struct type which contains a bunch of function pointers, and each 
> instance struct has a pointer to that common vtbl.  Then you write 
> wrappers as member functions of the struct, which call the vtbl 
> functions, pass "this" as the first argument.

yes you /could/ do this. But you can do regular OO program that way as 
well (and people used to IIRC). But for the same reason that all the 
mechanics is handled by the compiler with normal classes I'm wondering 
if the same could be done with these "dynamic classes". (also I kinda 
rather not have the extra function call to do the shelling)



More information about the Digitalmars-d mailing list