My snippet:
auto i = -2147483648;
int j = 3;
std::swap(i, j); // Compile error about mismatched types here.
The compiler states that the literal i
is a long long
. Why is that? -2147483648 fits in an int
on MSVC x64.
My compiler is MSVC, target is 64 bits.