No.
EDIT:
Slightly longer answer:
Technically, yes, but
- it is a lot more complicated
- you may have to create a temporary object (I am not sure if you can trick the compiler to do it on a pointer)
- you still must #undef offsetof, so you use preprocessor commands either way
- you need a different calling convention, meaning you have to rewrite the existing code
- you have additional constraints that offsetof has not (so it may not always work)
- it is still a hack
Thank you very much for the longer answer...I just was wondering why
.
Yes, then I agree with you. In such a case, the use of a macro seems to be a good solution.
Best wishes,
Michael