3 ms·
The OP also is not a valid substitution for "most" (by what metric, anyway?) uses of bit packing. The network wire doesn't need a C++ ABI-compatible object, an
by kolpa 8y ago
The OP also is not a valid substitution for "most" (by what metric, anyway?) uses of bit packing.
The network wire doesn't need a C++ ABI-compatible object, and clearly isn't portable when communicating between systems running different software.
For transmitting data over network, convert from local format to network format in transit.
> can only be used to save a bytes of memory
Yes, that's what "packing" is for.
- dokem 8y agoI think you are missing my points. This language feature cannot be used to eg, create a TCP header. It has nothing to do with the C++ ABI. And no, bit packing is not for memory saving, eg MISRA disallows bitpacking for the purpose of space saving.