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

Examples

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

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

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

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

Meta