smartOp.bsf

core.bitop.bsf without the undefined behaviour. smartOp.bsf(0) will raise IntFlag.undef.

template smartOp(IntFlagPolicy policy)
ubyte
bsf
@safe
(
N
)
(
const N num
)
if (
isFixedPoint!N
)

Examples

1 import checkedint.sticky : smartOp;
2 
3 assert(smartOp.bsf(20) == 2);
4 
5 smartOp.bsf(0);
6 assert(IntFlags.local.clear() == IntFlag.undef);

Meta