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.
  1. N bscal;
    struct SmartInt(N, IntFlagPolicy _policy, Flag!"bitOps" bitOps = Yes.bitOps)
    static if(bitOps)
    N bscal;
  2. inout(N) bscal [@property getter]

Examples

import checkedint.throws : SmartInt; // use IntFlagPolicy.throws

SmartInt!uint n;
static assert(is(typeof(n.bscal) == uint));

n = 7;
assert(n.bscal == 7);

n.bscal -= 8;
assert(n == uint.max);

Meta