How does inheritance and vtables work wrt. C++ and interop with D? Fns w/ Multiple-inheritance args impossible to bind to?

Adam D. Ruppe destructionator at gmail.com
Tue May 25 18:49:46 UTC 2021


On Tuesday, 25 May 2021 at 17:52:14 UTC, Gavin Ray wrote:
>   void takesADerived(Derived derived);
>
>   extern class Derived : Base1, Base2

Like I said in chat, these are NOT the same thing. The C++ 
Derived is a *sibling* class, not a parent, child, nor binding to 
the D Derived.

All your attempts to pass one off as the other is problematic. If 
you want to bind to the C++ derived, don't provide any bodies for 
the functions - just bind. If you want to inherit from it, you 
must first declare the binding in D, then inherit.



More information about the Digitalmars-d-learn mailing list