What are the rules used by C ++ to determine the type of an arithmetic expression with two different integer types?
In general, it is easy to solve the result, however, I came across cases with signed / unsigned ints that are confusing.
For example, both of the following are presented as unsigned int in VS.
unsigned int us = 0; int s = 1; auto result0 = us - s;
Is this the same for other compilers? Are there any specific rules for determining type?
source share