SmartInt.bscal

The basic scalar value of this SmartInt. Accessing this directly may be useful for:

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

Examples

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

Meta