3 ms·
Integer overflow is defined behaviour however, so we can provide library types which are checked. And since D's templates are very clean to define they are easy
by mhh__ 6y ago
Integer overflow is defined behaviour however, so we can provide library types which are checked. And since D's templates are very clean to define they are easy to use.
The null pointer thing is true however all the other mechanisms mentioned do help eliminate bumping into them, and there will be more on the way.
If you want to provide the null checks yourself D has Ada-style contract programming too.
- WalterBright 6y agoD also has a full set of a checked integer type: https://dlang.org/phobos/std_experimental_checkedint.html https://dlang.org/phobos/std_experimental_checkedint.html