How does one generically convert signed and unsigned integers into each other without having to specify the specific width?
For example:
uint8_t <-> int8_t
uint16_t <-> int16_t
uint32_t <-> int32_t
uint64_t <-> int64_t
It would be nice to write:
uint32_t x;
int32_t y;
static_cast<signed>(x)
static_cast<unsigned>(y)
However, I suspect that doesn't do what I want.
I think I can achieve a similar effect using this method but I would think doing it for the same data width might have some syntactic sugar.