Strange behavior of iota
jmh530
john.michael.hall at gmail.com
Wed Feb 16 20:37:19 UTC 2022
On Wednesday, 16 February 2022 at 19:35:00 UTC, jmh530 wrote:
> [snip]
>
> Step 1: In the integral overloads, use allSatisfy!(isSigned, B,
> E) || allSatisfy!(isUnsigned, T, U) for the current behavior
> Step 2: When !(allSatisfy!(isSigned, B, E) ||
> allSatisfy!(isUnsigned, T, U)), then convert to narrowest
> common type as I mentioned (long in your case).
>
> This would preserve the current size when the types are both
> either signed or unsigned and then would expand it only when
> there are different signed-ness. This also makes the behavior
> change at compile-time instead of throwing at runtime.
T/U should be B/E
More information about the Digitalmars-d-learn
mailing list