digitalmars.D - Druntime core.checkedint - for bearophile!
- Walter Bright (2/2) Jun 12 2014 https://github.com/D-Programming-Language/druntime/pull/839
- bearophile (13/15) Jun 13 2014 Just like the safe removal of unnecessary array bound tests, it
https://github.com/D-Programming-Language/druntime/pull/839 Yes, I know others are interested in this, too!
Jun 12 2014
Walter Bright:https://github.com/D-Programming-Language/druntime/pull/839 Yes, I know others are interested in this, too!Just like the safe removal of unnecessary array bound tests, it is also good to have some logic in the compiler to safely remove overflow tests. A possible start point is to expose the expression range values to the library code adding a __trait(value_range, some_expression). Here the compiler can remove the overflow check on the sum: Checked!int x, y; auto z = (x % 4) + (y % 4); This makes the checked values faster and will encourage more people to use them in their code. Bye, bearophile
Jun 13 2014