J
John Goche
Hello,
Consider the following macro to get the
memory offset of a class data member:
#define OFFSET(CLASSNAME, MEMBER) ((int) (&((CLASSNAME *) 0)->MEMBER))
Given that 0 may not be the address of
an instance of CLASSNAME, will this
code be legal in standard C++?
Thanks,
JG
Consider the following macro to get the
memory offset of a class data member:
#define OFFSET(CLASSNAME, MEMBER) ((int) (&((CLASSNAME *) 0)->MEMBER))
Given that 0 may not be the address of
an instance of CLASSNAME, will this
code be legal in standard C++?
Thanks,
JG