Need help with movement from C to D

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 6 07:34:53 PDT 2014


Artur Skawina:

> Keep in mind that D's offsetof is flawed - if the object does 
> not contain the requested member, but implicitly converts to 
> another one that does have such field then the expression
> compiles, but yields a bogus value. Eg
>
>    struct S { int a, b, c; S2 s2; alias s2 this; }
>    struct S2 { int d, e; }
>    static assert(S.e.offsetof==4); // Oops.

Is this in Bugzilla?

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list