@bitOffsetOf

@bitOffsetOf

@bitOffsetOf(comptime T: type, comptime field_name: [] const u8) comptime_int

Returns the bit offset of a field relative to its containing struct.

For non packed structs, this will always be divisible by 8. For packed structs, non-byte-aligned fields will share a byte offset, but they will have different bit offsets.

See also:

  • @byteOffsetOf