And here is why is bothering me:

auto max = isNegative ? cast(Unsigned!T)(-T.min) : cast(Unsigned!T)T.max);

The generic code above (which worked for all signed integral types T in 2.077) must be rewritten like this in 2.078:

static if (T.sizeof >= 4)
auto max = isNegative ? cast(Unsigned!T)(-T.min) : cast(Unsigned!T)T.max;
else
auto max = isNegative ? cast(Unsigned!T)(-cast(int)T.min) : cast(Unsigned!T)T.max;

Now I have to translate an 1-liner in a 4-liner all around my project.



Reply via email to