> On 07 Jul 2016, at 12:23, Walter Bright via dmd-internals 
> <[email protected]> wrote:
> 
> C++ classes have no dynamic type info (i.e. what the most derived class is). 
> But they do have static type info.

What I mean is this:

// first example, unrelated to the DMD codebase

extern(C++) class Foo {}

void main ()
{
    auto a = new Foo;
    assert(a.classinfo is null);
}

// second example, somewhere inside the DMD codebase

auto a = new IntegerExp(0);
assert(a.classinfo !is null);

Both of the above assertions pass. My question is why the second assertion pass.

—
/Jacob Carlborg
_______________________________________________
dmd-internals mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-internals

Reply via email to