smartInt

Get the value of num as a SmartInt!N. The integral type N can be infered from the argument.

@safe
SmartInt!(N, policy, bitOps)
smartInt
(
Flag!"bitOps" bitOps = Yes.bitOps
N
)
(
N num
)
if (
isIntegral!N ||
)

Examples

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

auto a = smartInt(55uL);
static assert(is(typeof(a) == SmartInt!ulong));
assert(a == 55);

Meta