After getting advised to read "C++ Primer 5 ed by Stanley B. Lipman" I don't understand this:Page 66. "Expressions Involving Unsigned Types"
(assuming 64bit machine)e.g.The maximum positive number that a regular signed integer (32bit) can store is 0x7FFFFFFF.
We have two unsigned counters, and we need to compare them to check for some error conditions:The problem is that a and b will overflow some day. If a overflowed, it's still OK. But if b overflowed, it would be a false alarm. How to make this check bulletproof?