So I'm taking a variable from one API, we'll call it long foo
and passing it to another API which takes it as the value: int bar
.
I'm in visual-studio-2017 in which these are effectively the same thing: https://learn.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=vs-2017
But this will fire:
static_assert(is_same_v<decltype(foo), decltype(bar)>);
Because even though these are effectively the same, they are not the same type. Is there a workaround for this, other than using the numeric limits library to match a long
to an int
?