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 expressioncompiles, but yields a bogus value. Egstruct 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