Document Bit-Level Details For Packed Data [DI36]
Tip DI36
Some programming languages may support defining data types with fields of specific bit widths. In such cases, you can document fields just like regular member variables. However, if you pack data into a single integer where certain ranges of bits have specific meanings, make sure to document those meanings.
See the following C++ example:
/// The color, packed in RGBA (red, green, blue, alpha) starting from
/// the most significant bit (highest number indicated below):
/// = Bits 24-31 = red
/// - Bits 16-23 = green
/// - Bits 8-15 = blue
/// - Bits 0-7 = alpha
uint32_t PackedColor = 0;
, multiple selections available,