Fun with extern(C++)
Walter Bright via Digitalmars-d
digitalmars-d at puremagic.com
Tue Jan 26 16:09:38 PST 2016
To understand this you have to step back and understand what interfaces actually
are.
They have one member, and that member is a pointer to its vtbl[]. The vtbl[] is
populated with pointers to functions.
That is it.
There is no runtime type info there.
Interfaces are how different languages communicate with each other - Java, D,
C++, Basic, etc., support this. This is one reason why there is no RTTI there.
An interface is supposed to stand on its own.
So yes, D and C++ can communicate via interfaces.
More information about the Digitalmars-d
mailing list