typeid() broken for interfaces?
Gor Gyolchanyan
gor.f.gyolchanyan at gmail.com
Fri Nov 30 02:45:46 PST 2012
If interfaces are supposed not to work in this case, is it possible to get
the offset of the interface in its object?
On Fri, Nov 30, 2012 at 2:04 PM, Gor Gyolchanyan <
gor.f.gyolchanyan at gmail.com> wrote:
> interface I { }
> class C: I { }
>
> I object = new C;
> assert(typeid(object) == typeid(C)); // fails
>
> Is this normal or is it a bug?
> Note, that the same works fine in case of a base class, rather then an
> interface.
>
> --
> Bye,
> Gor Gyolchanyan.
>
--
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20121130/48fcb25d/attachment.html>
More information about the Digitalmars-d
mailing list