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

Daniel Murphy yebbliesnospam at gmail.com
Sun Mar 30 20:26:17 PDT 2014


"Orvid King"  wrote in message 
news:mailman.124.1396235867.25518.digitalmars-d at puremagic.com...

> Actually, there is one big thing that this would break; C++ interop. With 
> the way interfaces currently work, you can define an interface with 
> virtual methods, and you can call those methods on that interface, and, if 
> you've properly overlayed it over a C++ class instance, you will be 
> calling a virtual method defined on that C++ class. Fat interfaces would 
> break this capability, and would actually break some of my existing code, 
> due to the fact I use that exact capability. I do however mark my 
> interfaces as extern(C++), so perhaps they would have to be an exception 
> to the ABI if this change were made?

We wouldn't be changing the C++ ABI, just the D ABI.  Only D interfaces 
would be affected. 



More information about the Digitalmars-d mailing list