Class info on interfaces

Jacob Carlborg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Aug 28 12:36:28 PDT 2015


On 2015-08-28 17:41, rumbu wrote:

> I don't know about Objective-C, but:
>
> - for native D interfaces __traits(getVirtualIndex,
> NativeInterface.firstFunction) == 1 since the first entry in vtbl is the
> contained object
> - for C++ interfaces __traits(getVirtualIndex,
> CPPInterface.firstFunction) == 0
> - COM interfaces: __traits(getVirtualIndex, CPPInterface.firstFunction)
> == 0 and inherit IUnknown

I'm wondering how reliable that is. Might be better to check the linkage 
of a method in the interface as Adam suggested.

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list