C++ (Qt)struct A { int m_B; short m_C; ... char m_Z;};
C++ (Qt)void A::ReadWrite( CBitStream & stream, TMode mode ) { stream.ReadWriteInt(&m_B, 4, mode); stream.ReadWriteShort(&m_C, 12, mode); ... stream.ReadWriteChar(&m_Z, 7, mode);}
C++ (Qt)template<N, S>struct Field { bool v // if N == 1 int8_t v // if N <= 8 && S=signed uint8_t v // if N <= 8 && S=unsigned ...};
C++ (Qt)std::array c = {std::byte{0}, std::byte{0x78}, std::byte{0x2}};
C++ (Qt) struct record { bit_field<1> flag; bit_field<4> mode; bit_field<9> address; bit_array pack() const { return ::pack( flag, mode, address ); } static record unpack( const bit_array &src ) { record result; ::unpack( src, result.flag, result.mode, result.address ); return result; } };