SafeInt.bscal

The basic integral value of this SafeInt. Accessing this directly may be useful for:

  • Intentionally doing modular (unchecked) arithmetic, or
  • Interacting with APIs that are not checkedint aware.
struct SafeInt(N, IntFlagPolicy _policy, Flag!"bitOps" bitOps = Yes.bitOps)
N bscal;

Examples

1 import checkedint.throws : SafeInt; // use IntFlagPolicy.throws
2 
3 SafeInt!uint n;
4 static assert(is(typeof(n.bscal) == uint));
5 
6 n = 7u;
7 assert(n.bscal == 7u);
8 
9 n.bscal -= 8u;
10 assert(n == uint.max);

Meta