@Karlos
sizeof() and offsetof() are usually implemented as macros on most implementations.
Wrong. 'sizeof' cannot be implemented with a macro. It's always builtin keyword in the compiler.
'offsetof' is a standard macro, in stddef.h (even standardized in POSIX these days).
That's the first indication that you can't absolutely rely on their behaviour in all cases.
Actually you can rely on sizeof.
Given that, I should point out that it can only work with concrete types that have already been "seen" by the compiler.
Well isn't that quite obvious, huh?
C++
C++ isn't C. ;-)