Skip to content

Commit

Permalink
Changelog for checkedint
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex authored and wilzbach committed Feb 26, 2017
1 parent 8358d21 commit 2749175
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions changelog/std-experimental-checkedint.dd
@@ -0,0 +1,21 @@
New: Checked, a lightweight and highly configurable checked integral

$(REF Checked, std, experimental, checkedint) is a wrapper around any integral
type that inserts checks against common sources of bugs: overflow in operators,
mixed-sign comparisons, and casts that lose information.

The example below illustrates the basic use of the facility:

-------
void main()
{
import std.experimental.checkedint, std.stdio;
writeln((checked(5) + 7).get); // 12
writeln((checked(10) * 1000 * 1000 * 1000).get); // Overflow
}
-------

By default, all checks are enabled and the program is aborted if any check
fails. An implementation based on hooks discoverable by using Design by
Introspection allows unbounded customizations of both the checks to do, and the
enforcement policy.

0 comments on commit 2749175

Please sign in to comment.