offsetof
is a compile time constant, if we look at the draft C++ standard section C.3
C standard library paragraph 2 says:
The C++ standard library provides 57 standard macros from the C library, as shown in Table 149.
and the table includes offsetof
. If we go to the C99 draft standard section 7.17
Common definitions paragraph 3 includes:
offsetof(type, member-designator)
which expands to an integer constant expression that has type size_t, the value of which is the offset in bytes [...]