What would be the consequence of implementing interfaces as fat pointers ?

Michel Fortin michel.fortin at michelf.ca
Tue Apr 1 05:03:52 PDT 2014


On 2014-04-01 07:11:51 +0000, Manu <turkeyman at gmail.com> said:

> Of course, I use alias this all the time too for various stuff. I said
> before, it's a useful tool and it's great D *can* do this stuff, but I'm
> talking about this particular super common use case where it's used to hack
> together nothing more than a class without a vtable, ie, a basic ref type.
> I'd say that's worth serious consideration as a 1st-class concept?

You don't need it as a 1st-class D concept though. Just implement the 
basics of the C++ object model in D, similar to what I did for 
Objective-C, and let people define their own extern(C++) classes with 
no base class. Bonus if it's binary compatible with the equivalent C++ 
class. Hasn't someone done that already?

-- 
Michel Fortin
michel.fortin at michelf.ca
http://michelf.ca



More information about the Digitalmars-d mailing list