Advantage of strict typification in C ++: practical experience

@
Show original
Our program processes network packages, in particular, the headings TCP/IP/etc. In them numerical values — shifts, counters, addresses — are presented in a network order of bytes (big-endian); we work at x86 (little-endian). In the standard structures describing headings, this field are presented by simple integer types (uint32_t, uint16_t). After several bugs because an order of bytes forgot to transform, we decided to replace types of fields with the classes forbidding implicit conversions and atypical operations...
Analysis
×