Comment #1 by destructionator — 2020-08-10T01:57:42Z
Might also work to check `is(T : IUnknown)` assuming you have the correct IUnknown available since all COM classes must use it as the base..... might work.
Comment #2 by andrei — 2020-08-10T02:38:25Z
IUnknown is declared in some Windows-specific modules, which I wouldn't want to import in object.d.
Comment #3 by bugzilla — 2020-08-10T20:57:25Z
IUnknown is declared as:
extern(Windows)
interface IUnknown {
int QueryInterface(const(GUID)* riid, void** pvObject);
uint AddRef();
uint Release();
}
GUID is:
align(1) struct GUID { // size is 16
align(1):
uint Data1;
ushort Data2;
ushort Data3;
ubyte[8] Data4;
}
We could move these from core.sys.windows.basetyps and unknown to object.d. Then Adam's prescription will work, without making the compiler more complex.
Comment #4 by robert.schadek — 2024-12-13T19:10:53Z