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...

Full article is available at its source

Go to full article
Open the Connections Tree and see if Telegram Open Network and are connected in any way
Try it

Sign up for more features!

Get full access to news analytics for free and without ads.

Article analysis

in this article