DoxigAlpha

ByteAlignedInt

Aligns the given integer type bit width to a width divisible by 8.

Source

Implementation

#
pub fn ByteAlignedInt(comptime T: type) type {
    const info = @typeInfo(T).int;
    const bits = (info.bits + 7) / 8 * 8;
    const extended_type = std.meta.Int(info.signedness, bits);
    return extended_type;
}