integral promotion not done for -val
I ended up with this, but is negating a short really this problematic, or did I miss something?
static if (!__traits(isUnsigned, T)) {
if (val < 0) {
static if (__traits(getPointerBitmap, T)[0] <
int.sizeof) {
val = cast(T)(-(cast(int)val));
} else {
val = -val;
}
}
}
As always, thanks much in advance,
Andy
