smartInt

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

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

Examples

1 import checkedint.throws : smartInt, SmartInt; // use IntFlagPolicy.throws
2 
3 auto a = smartInt(55uL);
4 static assert(is(typeof(a) == SmartInt!ulong));
5 assert(a == 55);

Meta