I've learned that when performing arithmetic on a signed and unsigned integers, the signed integer will be promoted to unsigned.
Based on that, I can't explain the behavior of this:
unsigned int u = 1000;
signed int i = -1;
std::cout << i + u << std::endl;
When I run this code, I get 999. I was expecting that i would be converted to unsigned, turning that -1 value to 4294967295.