Need help with movement from C to D

Andrey via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun May 4 20:57:52 PDT 2014


Guys, could someone help me with suitable template?

I have C macro, which calculates the offset of the field in a 
struct:

#define offsetof(type, field)	((long) &((type *)0)->field)

A similar D code is, as far as I know,

type.field.offsetof

Is there an any way to make a corresponding D template?

Thank you!


More information about the Digitalmars-d-learn mailing list