interfaces and such

Alex Rønne Petersen alex at lycus.org
Fri Jul 27 08:25:51 PDT 2012


On 27-07-2012 16:56, Gor Gyolchanyan wrote:
> I have a small question: why aren't interfaces implicitly convertible to
> Object?
>
> --
> Bye,
> Gor Gyolchanyan.

I don't know if there's any particular reason, but for what it's worth: 
Casting an interface to Object means going through its vtable back to 
the original object location. In other words, it's not "free" (though 
the cost is extremely minimal).

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list