Object and interface compatibility

Jarrett Billingsley kb3ctd2 at yahoo.com
Sun Feb 11 09:10:52 PST 2007


"Frits van Bommel" <fvbommel at REMwOVExCAPSs.nl> wrote in message 
news:eqmlfe$1e3v$1 at digitalmars.com...

> But isn't this only true for COM interfaces? The compiler knows when 
> compiling "i.toHash();" whether or not typeof(i) is an interface 
> inheriting from IUnknown, doesn't it? So it could make this work for all 
> other interfaces...

You know, that's entirely right.  The compiler should be able to do this.

> It's much easier solved by checking if "IUnknown" is a base of the 
> interface in question.

In fact, the compiler already seems to do this.. 





More information about the Digitalmars-d mailing list